Skip to content

Cannot use NPM Link with angular/cli v1.0.0-rc.2 any more #5428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
markuseckstein opened this issue Mar 15, 2017 · 4 comments
Closed
1 task

Cannot use NPM Link with angular/cli v1.0.0-rc.2 any more #5428

markuseckstein opened this issue Mar 15, 2017 · 4 comments

Comments

@markuseckstein
Copy link

Bug Report or Feature Request (mark with an x)

  • [x ] bug report -> please search issues before submitting
  • feature request

Versions.

@angular/cli: 1.0.0-rc.2
node: 7.6.0
os: win32 x64
@angular/common: 4.0.0-rc.3
@angular/compiler: 4.0.0-rc.3
@angular/core: 4.0.0-rc.3
@angular/forms: 4.0.0-rc.3
@angular/http: 4.0.0-rc.3
@angular/platform-browser: 4.0.0-rc.3
@angular/platform-browser-dynamic: 4.0.0-rc.3
@angular/router: 4.0.0-rc.3
@angular/cli: 1.0.0-rc.2
@angular/compiler-cli: 4.0.0-rc.3

Repro steps.

Create two simple Projects with cli:

ng new --ng4 project-a
ng new --ng4 project-b

Create a very simple component in project-b and export it in a module.
In project-b do:

npm link

In project-a do:

npm link project-b

and use the simple component from project-b. ng serve and ng build fails, regardless if using flag --aot or not.
If I pack the project-b with npm pack and then install the tarball in project-a instead of npm linking, everything works as expected.

The log given by the failure.

chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 158 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 6.58 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 9.89 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 1.96 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

ERROR in Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol NgModule in C:/temp/test1/projA/node_modules/proj-b/node_modules/@angular/core/typings/core.d.ts, resolving symbol BeeModule in C:/temp/test1/projA/node_modules/proj-b/src/app/bee/bee.module.ts, resolving symbol BeeModule in C:/temp/test1/projA/node_modules/proj-b/src/app/bee/bee.module.ts

Desired functionality.

I want to be able to use NPM LINK because this saves so much time during development.

Mention any other details that might be useful.

It still worked in [email protected]

@filipesilva
Copy link
Contributor

Heya, errors like Error encountered resolving symbol values statically mean that there has been some problem in statically analyzing your app.

The CLI always runs statical analysis on code to ensure it will run when compiled with AOT. This may cause a lot of static analysis errors to surface when importing your project into the CLI, or upgrading for older versions where we didn't run this kind of analysis.

A good resource on how to to debug these errors is https://github.com/rangle/angular-2-aot-sandbox#aot-dos-and-donts.

@markuseckstein
Copy link
Author

Hi @filipesilva ,
thanks for the AOT tipp, but this issue is somewhat different because it happens even for two totally fresh projects created by the CLI (which surely do not use any AOT-incompatible code).

And as stated in the issue, it happens only of you use NPM Link to reference the two projects. When I use for example NPM pack and install the generated tarball in the other project, everything works fine.

We tried on Linux as well, there the issue exists as well. When referencing the tarball, everything works as expected. When using NPM link, ng build fails.

For our project it's really a pain that we cannot use NPM link any more. This slows us down tremendously.

best regards,
Markus

@filipesilva
Copy link
Contributor

If it works without npm link, then you might be getting #3847 or a number of the other issues we have with npm link.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants