Nuxt.js: want to hook on page component js import error

Created on 30 Nov 2017  路  8Comments  路  Source: nuxt/nuxt.js

nuxt page component js filename changes every time we use npm build

Considering deployment, for example, if a user uses our nuxt app and then we build and deploy new nuxt app, the user no longer be able to go to next page by SPA because the next page component js filename changes and no longer import and render. it's not good...

2017-11-29 17 57 06

i would say one idea avoiding this problem is support for adding custom hook on page component js import error. (for example, refresh the browser)

any ideas ??

This feature request is available on Nuxt.js community (#c2001)
enhancement

Most helpful comment

Hi @igtm

Indeed we may work on this issue to reload the app if the chunk is not found.

All 8 comments

The hash of filename in calculated from content of component file, it will be changed only when content of file is changed.

In development, every change will lead to a dev rebuilding and hot-replacing and file will be replaced.

In production, every change should be deployed by rebuilding and restarting and users will access new files directly.

What are your specific operating steps ?

Thanks your response.

We use ECS (AWS) for operating Nuxt app.
So when deploying our new version app, the app is fully replaced.

So again, if there are some users that still use old version app when we switch old version app to new version app, the users fail to go to next page by spa(nuxt-link tag) if the next page component js filename changes...

If our app should be deployed very frequently (for example, thousands in a day), many users will encounter to the problem. It鈥檚 very bad for UX...

Any solutions??

note: page components are imported dynamically (on SPA). so if the js file is 404, the nuxt app on client browser cannot render the next page and throw error.

/cc @Atinux @pi0

Hi @igtm

Indeed we may work on this issue to reload the app if the chunk is not found.

Our production facing this issue also when keep update to live server , load chunk fail 馃槪

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazycrazy picture lazycrazy  路  3Comments

vadimsg picture vadimsg  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments

maicong picture maicong  路  3Comments

vadimsg picture vadimsg  路  3Comments