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.

Ran Update with New Version of CLI, Now Getting a "webpack: Failed to compile" Error

See original GitHub issue
  • Running this on a MacBook Air, with OS X El Capitan V. 10.11.6

  • Running @angular/cli: 1.0.0-beta.30

First I did this:

npm uninstall -g angular-cli @angular/cli npm cache clean npm install -g @angular/cli@latest

  • This was going from beta.24 to beta.30.

Then, for my project, I followed these directions:

rm -rf node_modules dist npm install --save-dev @angular/cli@latest npm install ng update

Note: when prompted Y or N to update various files, I selected “Y” for most, only selecting “N” for files that would potentially override my custom setup - for instance for package.json. app.component.ts, index.html, etc.

Then, after fixing some absolute path issues in a few of the components, I got my app to install, compile, and boot up.

But then, after restarting my computer, when I run “ng serve” again, I get a “webpack: Failed to compile” error with absolutely no other information. Nothing in the terminal view of Visual Studio Code, and nothing in the console on my browser.

This is what I see in my terminal after running “ng s”:


> bash-3.2$ ng s
> fallbackLoader option has been deprecated - replace with "fallback"
> loader option has been deprecated - replace with "use"
> fallbackLoader option has been deprecated - replace with "fallback"
> loader option has been deprecated - replace with "use"
> fallbackLoader option has been deprecated - replace with "fallback"
> loader option has been deprecated - replace with "use"
> fallbackLoader option has been deprecated - replace with "fallback"
> loader option has been deprecated - replace with "use"
> ** NG Live Development Server is running on http://localhost:4200. **
> Hash: 4a9eeeb8e7122c071da3
> Time: 25802ms
> chunk    {0} main.bundle.js, main.bundle.map (main) 755 kB {3} [initial] [rendered]
> chunk    {1} polyfills.bundle.js, polyfills.bundle.map (polyfills) 201 kB {4} [initial] [rendered]
> chunk    {2} styles.bundle.js, styles.bundle.map (styles) 27 kB {4} [initial] [rendered]
> chunk    {3} vendor.bundle.js, vendor.bundle.map (vendor) 5.22 MB [initial] [rendered]
> chunk    {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
> 
> ERROR in Cannot read property 'listLazyRoutes' of undefined
> webpack: Failed to compile.

One note, I was getting the “ERROR in Cannot read property ‘listLazyRoutes’ of undefined” error before upgrading my CLI version, but it wasn’t stopping the app from booting up, and I assume that issue is unrelated to not getting the app to boot up now.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
asmauscommented, Feb 11, 2017

Replace “fallbackLoader” by “fallback”, and replace “loader” by “use” in styles.js file (node_modules/angular-cli/models/webpack-configs/styles.js) attention: angular-cli folder, not @angular-cli folder.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 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

Angular: when ran “ng serve”, then error “webpack: Failed to ...
I use mac ox (10.11.6), and tried to learn Angular. I installed node.js, typescript and angular-cli, and every thing works well. However, ...
Read more >
webpack Tutorial: How to Set Up webpack 5 From Scratch
What are the main things we want this webpack config to do? Compile the latest and greatest JavaScript to a version the browser...
Read more >
Error: running webpack failed - Indico Community
Hi! updating on one of our machines, trying to build-assets for core – that ... new CopyPlugin (/data/opt/indico/src/node_modules/copy-webpack-plugin/dist/ ...
Read more >
sage - Roots Discourse
Updated Sage 9.x You can now try out the Sage PR branch for webpack 5 and ... ERROR Failed to compile with 2...
Read more >
Development - webpack
[webpack-cli] Compilation finished asset index.bundle.js 1.38 MiB [emitted] ... If one of these files is updated, the code will be recompiled so you...
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