Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuxt build fails at generating pages in spa mode #6500

Closed
alexkcollier opened this issue Oct 2, 2019 · 27 comments
Closed

nuxt build fails at generating pages in spa mode #6500

alexkcollier opened this issue Oct 2, 2019 · 27 comments

Comments

@alexkcollier
Copy link

Version

v2.10.0

Reproduction link

https://gitlab.com/alexkcollier/nuxt-build-repro

Steps to reproduce

  1. Create nuxt project
  2. Set mode to spa in nuxt.config.js
  3. yarn build

What is expected ?

Build succeeds

What is actually happening?

FATAL Cannot read property 'renderRoute' of undefined

error.png

Additional comments?

yarn generate works as expected, and so does building in universal mode.

This bug report is available on Nuxt community (#c9850)
@ghost ghost added the cmty:bug-report label Oct 2, 2019
@1001v
Copy link

1001v commented Oct 2, 2019

I have the same issue on 2.10. There're no problems with 2.9.1.

@AndrewBogdanovTSS
Copy link

It happens not only in SPA mode but also in Universal, with and without a --modern flag. Dev mode is working fine though

@Denoder
Copy link

Denoder commented Oct 3, 2019

Can also confirm this happening with 2.10.0
2.9 and below works fine.

@AlexSwtlsk
Copy link

Same here

1 similar comment
@sbrieuc
Copy link

sbrieuc commented Oct 3, 2019

Same here

@AndrewBogdanovTSS
Copy link

Guys, please, do not pollute the topic with the same messages. It's already clear that a lot of us have this issue

@moritzsternemann
Copy link

Looks like the breaking change happened in the @nuxt/generator@2.10.0 update. Works fine using 2.9.1.

@liyasthomas
Copy link

liyasthomas commented Oct 4, 2019

Build fails in Docker/Local/CI. Same here while generating pages in 'spa' mode.

TypeError: Cannot read property 'renderRoute' of undefined

@josepjaume
Copy link

josepjaume commented Oct 4, 2019

Same happens to me on 2.10.0 but I tried reverting to 2.9.1 without success - maybe it's cause a transient dependency?

@AndrewBogdanovTSS
Copy link

@pi0 @manniL maybe you could provide some update on whether this issue is being addressed by the Nuxt team? Thank you

@jmartinezuk
Copy link

Same here. Went back to 2.9.1 until it's fixed.

@SamJakob
Copy link

SamJakob commented Oct 4, 2019

I had this issue but I went back to 2.9.2 which also worked fine.

@catisnorm
Copy link

Same happens to me on 2.10.0 but I tried reverting to 2.9.1 without success - maybe it's cause a transient dependency?

Did you removed node_modules and package-lock?
https://nuxtjs.org/guide/upgrading#npm

@madmod
Copy link

madmod commented Oct 5, 2019

I ran into this after removing package-lock.json and node_modules while working on something unrelated. A fresh npm i with package.json set to "2.9.2" fixed the issue.

@vinayakkulkarni
Copy link

Related issues: #6514 & #6513

@riux
Copy link

riux commented Oct 8, 2019

I imagine that this error is solved in the next version

@AndrewBogdanovTSS
Copy link

@riux it better be since now 2.10.0 is not usable for many people

@edellaq
Copy link

edellaq commented Oct 8, 2019

I'm not very fond of these things, but while tweaking here and there think I was able to build my SPA using 'npm run generate' instead of 'npm run build' (that gave the error)...

@vinayakkulkarni
Copy link

Fixed via 136777d

@riux
Copy link

riux commented Oct 9, 2019

I still have the error after changing to nuxt 2.9.2 (remove node_modules and yarn.lock from src / and from function /). This only happens when deploying in firebase hosting. The error occurs when I update the "f5" page in a different index path (domain.com/video/id_video). I clarify that this error does not occur in (yarn dev, nor in yarn start)
firefox
image
chrome
image

@laitingyou
Copy link

image
Waiting for a new version to be released.

@vinayakkulkarni
Copy link

this has been already fixed in #6525

#6529 is v2.10.1

@riux
Copy link

riux commented Oct 10, 2019

I update to that version it only shows me v2.10

@AndrewBogdanovTSS
Copy link

@riux because Nuxt 2.10.1 wasn't officially released yet. You should wait. And please, use English

@alexkcollier
Copy link
Author

nuxt@2.10.1 has been released, fixing the issue

@riux
Copy link

riux commented Oct 11, 2019

Well, I haven't updated to the new version yet. But I discovered that this error occurred for two reasons: 1) .Use the nuxt functions (asyncData, fetch) on a page with dynamic URL (search / _stringSearch.vue), then I had to change these functions to created () {. ..}.
2) I also found myself in the need to enclose
content of my page (search / _stringSearch.vue), with <client-only> .... </client-only>. My development environment is a universal application that uses the firebase and firebase hosting functions. As I mentioned, the error occurred at the time of the test in Firebase Hosting (Nuxt Build, Firebase Implement)
image
image

image

@alexkcollier
Copy link
Author

alexkcollier commented Oct 11, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests