Nuxt.js: Cannot read property 'renderRoute' of undefined

Created on 4 Oct 2019  Â·  18Comments  Â·  Source: nuxt/nuxt.js

I have the same issue as well. Just install 2.10.0 and the problem started acting. Node v10.15.3, and all projects with different nuxt version will have this error message.

Cannot read property 'renderRoute' of undefined 18:06:13

at Generator.afterGenerate (node_modules/@nuxt/generator/dist/generator.js:168:43)
@visualfanatic
@ConsoleTVs

This question is available on Nuxt community (#c9862)

All 18 comments

This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c9862.

same error in here

Generator.afterGenerate (node_modules/@nuxt/generator/dist/generator.js:168:43)

Same here...

TypeError: Cannot read property 'renderRoute' of undefined
at Generator.generateRoute (.../node_modules/@nuxt/generator/dist/generator.js:222:42)

Same here.
Looks like a degression caused by https://github.com/nuxt/nuxt.js/commit/95e043f1679f9d3bf1f6508282ac0c6ec468f4d8 .
This change blocked server from being initialized (cf. https://github.com/nuxt/nuxt.js/blob/9ad02c4/packages/core/src/nuxt.js#L38-L40).
This looks like an emergent bug as it basically means nuxt build and nuxt generate are not working at all atm, and there's no workaround known (any ideas? cc: @clarkdo @pi0 )
Thanks :)

yep facing the same issue, trying with yarn, ref: https://github.com/nuxt/nuxt.js/issues/6514#issuecomment-538553205

Yes same with yarn, removed * nodes-modules and package-lock.json, did a clean yarn install, and when running yarn run build, I get exactly the same error.

Same here, only on the build server i can actually build locally.

I am facing similar in SPA mode
https://github.com/nuxt/nuxt.js/issues/6526

I'm facing same problem for SPA mode
https://github.com/nuxt/nuxt.js/commit/95e043f1679f9d3bf1f6508282ac0c6ec468f4d8

Work around, edit file node_modules/@nuxt/cli/dist/cli-build.js
line 81: change from

    const config = await cmd.getNuxtConfig({ dev: false, server: false, _build: true });

to

    const config = await cmd.getNuxtConfig({ dev: false, _build: true });

now I can nuxt build

Should be fixed in v2.10.1 since #6525 is now merged.. waiting to run npm up my project(s). ;)

still got the error with v2.10.1

still got the error with v2.10.1

Works for me, you sure you also actually installed the new version?

still got the error with v2.10.1

@frederic117 :

npm up && rm -rf node_modules/ package-lock.json && npm i

have you tried this?

Yes it is fixed!

For yarn check if you have nuxt version pined in package.json, then:

rm -Rf node_modules/ && rm yarn.lock && yarn

Hi,

i've the same issue i tried

rm -R -force node_modules/
rm yarn.lock
yarn

I tried
rm -Rf node_modules/ && rm yarn.lock && yarn
But still the same error 😭

FATAL Cannot read property 'renderRoute' of undefined
remote:
remote: at ModuleContainer.cacheRenderer (node_modules/nuxt-ssr-cache/lib/middleware.js:64:30)
remote: at ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:190:34)
remote: at promise.then (node_modules/@nuxt/utils/dist/utils.js:1802:43)
remote: at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:52:5)
remote: at Function.Module.runMain (internal/modules/cjs/loader.js:880:11)
remote: at internal/main/run_main_module.js:21:11

You are still in the old version.

Check package.json: "nuxt": "^2.10.1"

On Fri, 11 Oct 2019 at 17:35, fred notifications@github.com wrote:

FATAL Cannot read property 'renderRoute' of undefined
remote:
remote: at ModuleContainer.cacheRenderer
(node_modules/nuxt-ssr-cache/lib/middleware.js:64:30)
remote: at ModuleContainer.addModule
(node_modules/@nuxt/core/dist/core.js:190:34)
remote: at promise.then (node_modules/@nuxt/utils/dist/utils.js:1802:43)
remote: at process.runNextTicks [as _tickCallback]
(internal/process/task_queues.js:52:5)
remote: at Function.Module.runMain (internal/modules/cjs/loader.js:880:11)
remote: at internal/main/run_main_module.js:21:11

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/nuxt/nuxt.js/issues/6513?email_source=notifications&email_token=ABMWU2CKUH7VI7TEYFMKN73QOCTLNA5CNFSM4I5N4X7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBAREDY#issuecomment-541135375,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABMWU2COAALXXBZPOWCCX6LQOCTLNANCNFSM4I5N4X7A
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pehbehbeh picture pehbehbeh  Â·  3Comments

gary149 picture gary149  Â·  3Comments

mikekidder picture mikekidder  Â·  3Comments

maicong picture maicong  Â·  3Comments

bimohxh picture bimohxh  Â·  3Comments