npm link breaks server side pre-rendering #1344

Closed
opened 2025-08-09 17:19:46 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @jmezach on 10/3/2016

I have setup a new project using the Yeoman generator and using Angular 2 as my SPA framework. Everything seems to be working just fine. Now I'm trying to fix an issue in a module I'm using (angular2-moment) and I want to link my application to the locally build version of that module that I have on my system. So I used npm link to do that. This creates a symbolic link inside node_modules for my application to the physical location of that module on my system.

Unfortunately once I did that I'm getting the following error message:

An unhandled exception occurred while processing the request.

Exception: Call to Node module failed with error: Error: Unexpected value 'MomentModule' imported by the module 'AppModule'
at /Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:14126:37
at Array.forEach (native)
at Object.Call (/Users/jmezach/Projects/blog-engine/node_modules/es6-shim/es6-shim.js:289:14)
at Array.forEach (/Users/jmezach/Projects/blog-engine/node_modules/es6-shim/es6-shim.js:1295:17)
at CompileMetadataResolver.getNgModuleMetadata (/Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:14111:46)
at RuntimeCompiler._compileComponents (/Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:16803:49)
at RuntimeCompiler._compileModuleAndComponents (/Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:16741:39)
at RuntimeCompiler.compileModuleAsync (/Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:16732:23)
at NodePlatform.bootstrapModule (/Users/jmezach/Projects/blog-engine/node_modules/angular2-platform-node/node-platform.js:436:25)
at NodePlatform.serializeModule (/Users/jmezach/Projects/blog-engine/node_modules/angular2-platform-node/node-platform.js:108:22)
MoveNext

This seems to indicate that it can no longer find the module, but I'm not quite sure why. The structure inside the module folder is exactly the same as when I just npm install the module directly. It looks almost like its not following symlinks. Not sure if this is the right place for this issue but right now I don't know of any other place to look. Any thoughts on this?

*Originally created by @jmezach on 10/3/2016* I have setup a new project using the Yeoman generator and using Angular 2 as my SPA framework. Everything seems to be working just fine. Now I'm trying to fix an issue in a module I'm using (angular2-moment) and I want to link my application to the locally build version of that module that I have on my system. So I used npm link to do that. This creates a symbolic link inside node_modules for my application to the physical location of that module on my system. Unfortunately once I did that I'm getting the following error message: ``` An unhandled exception occurred while processing the request. Exception: Call to Node module failed with error: Error: Unexpected value 'MomentModule' imported by the module 'AppModule' at /Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:14126:37 at Array.forEach (native) at Object.Call (/Users/jmezach/Projects/blog-engine/node_modules/es6-shim/es6-shim.js:289:14) at Array.forEach (/Users/jmezach/Projects/blog-engine/node_modules/es6-shim/es6-shim.js:1295:17) at CompileMetadataResolver.getNgModuleMetadata (/Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:14111:46) at RuntimeCompiler._compileComponents (/Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:16803:49) at RuntimeCompiler._compileModuleAndComponents (/Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:16741:39) at RuntimeCompiler.compileModuleAsync (/Users/jmezach/Projects/blog-engine/node_modules/@angular/compiler/bundles/compiler.umd.js:16732:23) at NodePlatform.bootstrapModule (/Users/jmezach/Projects/blog-engine/node_modules/angular2-platform-node/node-platform.js:436:25) at NodePlatform.serializeModule (/Users/jmezach/Projects/blog-engine/node_modules/angular2-platform-node/node-platform.js:108:22) MoveNext ``` This seems to indicate that it can no longer find the module, but I'm not quite sure why. The structure inside the module folder is exactly the same as when I just npm install the module directly. It looks almost like its not following symlinks. Not sure if this is the right place for this issue but right now I don't know of any other place to look. Any thoughts on this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1344
No description provided.