question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack Angular2 does not work with node_modules

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pedro-sanchezcommented, Nov 18, 2016

I Have the same problem

In angular version 2.1.2 work.

When upgrade to 2.2.0 got the same error.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 11, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found