Skip to content

Failed to fetch dynamically imported module #3978

@knajjars

Description

@knajjars

Describe the bug

Hi, we are using SvelteKit on production for a while now and recently added Sentry to monitor errors.

Some of our settings:

  • SSR: off
  • Pre-render: disabled
  • adapter: static
  • hosting: netlify
  • it's a SPA (we have fallback to index.html)

The error log looks something like this:
Failed to fetch dynamically imported module: https://<our_page.com>/_app/pages/index.svelte-91a57275.js

And the odd thing is that it does not happen on any particular route and not always, but often enough.

Reproduction

It is not reproducible on development and it happens randomly. Probably something to do with SPA?

Logs

TypeError: 'text/html' is not a valid JavaScript MIME type.
Failed to fetch dynamically imported module: https://<our_page.com>/_app/pages/index.svelte-91a57275.js

System Info

System:
    OS: macOS 12.0.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Memory: 31.21 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.2 - ~/.nvm/versions/node/v14.17.2/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 7.23.0 - ~/.nvm/versions/node/v14.17.2/bin/npm
    Watchman: 2022.01.03.00 - /usr/local/bin/watchman
  Browsers:
    Brave Browser: 98.1.35.101
    Chrome: 98.0.4758.102
    Firefox: 97.0
    Safari: 15.1
  npmPackages:
    @sveltejs/adapter-static: ^1.0.0-next.28 => 1.0.0-next.28
    @sveltejs/kit: ^1.0.0-next.266 => 1.0.0-next.266
    svelte: ^3.45.0 => 3.45.0

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions