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

ChunkLoadError: Loading chunk {n} failed. #7725

Closed
lopermo opened this issue Jul 16, 2020 · 7 comments
Closed

ChunkLoadError: Loading chunk {n} failed. #7725

lopermo opened this issue Jul 16, 2020 · 7 comments

Comments

@lopermo
Copy link

lopermo commented Jul 16, 2020

Versions

  • nuxt: v2.13.3
  • node: v11.12.0

Reproduction

I receive the following errors after building full-static spa page (nuxt build && nuxt export):

Failed to load resource: the server responded with a status of 404 (Not Found)  http://localhost:3000/_nuxt/pages/contact.pages/index.pages/portfolio.pages/project/hotailors.pages/project/mtank.pages/project/.40117ef1.cba329a.js
ChunkLoadError: Loading chunk 1 failed.
(error: http://localhost:3000/_nuxt/pages/contact.pages/index.pages/portfolio.pages/project/hotailors.pages/project/mtank.pages/project/.40117ef1.cba329a.js)

nuxt dev works fine, the whole site works without problems.

mode: 'spa',
target: 'static',
modules: [
    '@bazzite/nuxt-optimized-images',
    '@nuxtjs/axios',
    '@nuxtjs/eslint-module',
    '@nuxtjs/robots',
    '@nuxtjs/redirect-module',
    'qonfucius-nuxt-fontawesome',
    '@nuxt/content',
    '@nuxt/components',
    '@nuxtjs/device',
    'vue-scrollto/nuxt',
    'bootstrap-vue/nuxt',
    ['@nuxtjs/dotenv', { filename: '.env' }],
    [
      '@nuxtjs/google-analytics',
      {
        id: '..',
        dev: false
      }
    ],
    [
      'nuxt-i18n',
      {
        rootRedirect: 'es',
        strategy: 'prefix',
        locales: [
          {
            code: 'en',
            iso: 'en-US',
            name: 'English',
            flag: '🇬🇧',
            file: 'en.js'
          },
          {
            code: 'es',
            iso: 'es-ES',
            name: 'Español',
            flag: '🇪🇸',
            file: 'es.js'
          }
        ],
        defaultLocale: 'es',
        lazy: true,
        seo: false,
        langDir: 'lang/',
        detectBrowserLanguage: {
          useCookie: true,
          cookieKey: 'language_cookie',
          // If no locale for the browsers locale is a match, use this one as a fallback
          fallbackLocale: 'es'
        }
      }
    ],
    '@nuxtjs/sitemap'
  ]

Steps to reproduce

nuxt build && nuxt export
When loading any page of the website, the loader spinner will keep spinning forever and you can read the errors on the console.

If I serve the website locally with a simple python HTTP server, it works even though the error's still there. nuxt serve or netlify will always fail (keep the loader spinning and error in console).

What is Expected?

Normal navigation through the website just as during development.
It works if I build it with mode: 'universal'

What is actually happening?

The website doesn't work. Console's output after nuxt build && nuxt export is weird chunks like this:

pages/index.pages/portfolio.pages/project/hotailors.pages/project/mtank.pages/project/numadoo.pages/.11bb9524.81514e9.js (345 KiB)
pages/project/hotailors.pages/project/mtank.pages/project/numadoo.d7c8c70.js (282 KiB)
@danielroe
Copy link
Member

Should be fixed by #7667

@lopermo
Copy link
Author

lopermo commented Jul 16, 2020

Should be fixed by #7667

Is there any way to fix it before v2.14 is released? I can't update my webpage because of it.
I assume then that the error is nuxt's, there's nothing I can do to fix it?

@danielroe
Copy link
Member

@lopermo This workaround should solve it: #7665 (comment)

@stale
Copy link

stale bot commented Aug 16, 2020

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

@stale stale bot added the stale label Aug 16, 2020
@zoxon
Copy link

zoxon commented Aug 21, 2020

Workaround above not helped to me. Only downgrade nuxt to v2.13.3 helps

@stale stale bot removed the stale label Aug 21, 2020
@stale
Copy link

stale bot commented Sep 20, 2020

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

@stale stale bot added the stale label Sep 20, 2020
@stale stale bot closed this as completed Sep 27, 2020
@pitpit
Copy link

pitpit commented Mar 12, 2021

Commenting for dummies like me that are facing this issue.

On Brave browser in dev mode, I have this error ChunkLoadError: Loading chunk pages/mypage/_id failed. on routes with params generated from pages/

I discovered the adblocker was blocking the chunk to be loaded.

So disable and it will work like a charm...

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

4 participants