Webpack Angular2 does not work with node_modules
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Building an angular2 component and using it from npm does not work - the webpack build finishes fine but it gives an error in the browser:
Uncaught Error: Unexpected value 'PLIconModule' imported by the module 'AppModule'(…)
Expected behavior No error in the browser.
Minimal reproduction of the problem with instructions Add an angular2 component as an npm dependency and try to import it and build with webpack.
What is the motivation / use case for changing the behavior?
Please tell us about your environment: Mac OSX
-
Angular version: 2.0.X
-
Browser: [all]
-
Language: [TypeScript X.X]
-
Node (for AoT issues):
node --version
= v5.8.0
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Cannot find module 'webpack' - Angular - Stack Overflow
I cleared node modules and: npm cache clean --force; npm install; npm install --save-dev @angular/cli@latest.
Read more >Creating libraries - Angular
This page provides a conceptual overview of how to create and publish new libraries to extend Angular functionality. If you find that you...
Read more >Angular - Code with Mosh Forum
Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): · delete the node_modules folder · delete package-lock.json ...
Read more >To v5 from v4 - webpack
This guide aims to help you migrating to webpack 5 when using webpack directly. If you are using a higher level tool to...
Read more >How to configure Webpack 4 with Angular 7: a complete guide
It's essential to install node and core-js types definition. Without it, TypeScript won't be able to compile our Angular application to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I Have the same problem
In angular version 2.1.2 work.
When upgrade to 2.2.0 got the same error.
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.