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.

TypeError: Cannot read property 'eagerRoutes' of undefined

See original GitHub issue

Can´t read property ‘eagerRoutes’ of undefined

My extend.webpack.config.js is like below:

const { GuessPlugin } = require('guess-webpack');
const { parseRoutes } = require('guess-parser');

module.exports = {
  plugins: [
    new GuessPlugin({
      GA: '<GAV Id>', 
      runtime: {
        delegate: false
      },
      routeProvider() {
        return parseRoutes('.');
      }
    })
  ]
};

But I get this error when I run the ng build --prod command.

(node:1672) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'eagerRoutes' of undefined
    at collectRoutingModules (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\guess-parser\dist\guess-parser\index.js:465:17)
    at processLazyRoute (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\guess-parser\dist\guess-parser\index.js:463:9)
    at Array.forEach (<anonymous>)
    at collectRoutingModules (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\guess-parser\dist\guess-parser\index.js:466:28)
    at Object.exports.parseRoutes (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\guess-parser\dist\guess-parser\index.js:598:9)
    at exports.parseRoutes (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\guess-parser\dist\guess-parser\index.js:843:28)
    at Object.routeProvider (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\extend.webpack.config.js:16:16)
    at extractRoutes (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\guess-webpack\dist\guess-webpack\main.js:457:39)
    at GuessPlugin._execute (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\guess-webpack\dist\guess-webpack\main.js:490:9)
    at C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\guess-webpack\dist\guess-webpack\main.js:486:54
    at _next0 (eval at create (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1)
    at eval (eval at create (C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:28:1)
    at C:\Users\aleja\OneDrive\Documents\Cursos\Angular\platzi-store\node_modules\copy-webpack-plugin\dist\index.js:91:9
(node:1672) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1672) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mgechevcommented, Jan 23, 2020

Unfortunately, there’s nothing I can do at this point. You can generate JWT tokens and provide them to Guess.js in a similar way I did here.

1reaction
mgechevcommented, Jan 23, 2020

Not sure what the text says. Would you translate?

Read more comments on GitHub >

github_iconTop Results From Across the Web

router.use TypeError: Cannot read property 'use' of undefined
I used npm install -g express-generator@3 command yesterday, so it make my global setting to express version 3. I uninstall and install express ......
Read more >
Routing error in dev mode: TypeError: Cannot read property ...
Unhandled Runtime Error TypeError: Cannot read property 'includes' of undefined Call Stack Router._resolveHref webpack-internal:///.
Read more >
ERROR TypeError: Cannot read property title of undefined
HEY, SET YOUR LIKE THERE ! ... Your browser can't play this video. ... Solved: ERROR TypeError : Cannot read property title of...
Read more >
ANGULAR 13 TypeError Cannot read property of undefined
In this tutorial, we will see a most common error faced by the Angular developers named as " TypeError Cannot read property of...
Read more >
Cannot read properties of undefined' - JavaScript Debugging
How To Fix 'Uncaught TypeError : Cannot read properties of undefined ' - JavaScript Debugging.
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