Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 5 - Uncaught ReferenceError: req is not defined

I recently updated my running project from Angular 4.4.3 to Angular5. I updated all angular packages to Angular 5.0.0 as per the update guide.

Plus I also updated the angular CLI to 1.5.0. Since then I am getting below error in console:

polyfills.b8a5e5b….bundle.js:1 Uncaught ReferenceError: req is not defined
    at polyfills.b8a5e5b….bundle.js:1
    at polyfills.b8a5e5b….bundle.js:1
    at polyfills.b8a5e5b….bundle.js:1
    at Function.r.__load_patch (polyfills.b8a5e5b….bundle.js:1)
    at polyfills.b8a5e5b….bundle.js:1
    at c (polyfills.b8a5e5b….bundle.js:1)
    at Object.<anonymous> (polyfills.b8a5e5b….bundle.js:1)
    at Object.eFQL (polyfills.b8a5e5b….bundle.js:1)
    at n (inline.904a54f….bundle.js:1)
    at Object.TU+8 (polyfills.b8a5e5b….bundle.js:1)

Am I missing something here?

like image 240
Peter Avatar asked Dec 24 '22 12:12

Peter


2 Answers

It's actually just a bug with uglify-es. Update uglify-es on your project to >3.1.8 until it's fixed in the CLI. Got the answer from here

like image 149
zmanc Avatar answered Dec 28 '22 10:12

zmanc


Remove node_modules and run npm install.

It works for me.

like image 35
pali Avatar answered Dec 28 '22 10:12

pali