You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am on the latest version of Snowpack & all plugins.
I use package manager npm (Fill in: npm, yarn, pnpm, etc).
I run Snowpack on OS Linux (Fill in: Windows, Mac, Linux, etc).
I run Snowpack on Node.js v12+
Describe the bug
I have an import config from "./config.json" in one of my typescript files.
This builds fine, with no errors, however when the app is opened in the browser, I get an error in the console: Failed to load module script: The server responded with a non-JavaScript MIME type of "application/json". Strict MIME type checking is enforced for module scripts per HTML spec.
To Reproduce
npx create-snowpack-app dir --template @snowpack/app-template-svelte-typescript
Create a .json file in src/ and import it from index.ts.
Set bundle: true in snowpack's optimize config
npm run build
Go in the build/ folder and start a webserver
Open the app in your browser
See error in the console!
Expected behavior
There should be no error. The .json file should import without problem, just like with bundle: false.
Anything else?
Looks like the issue is caused by bundle: true.
The text was updated successfully, but these errors were encountered:
Bug Report Quick Checklist
Describe the bug
import config from "./config.json"
in one of my typescript files.Failed to load module script: The server responded with a non-JavaScript MIME type of "application/json". Strict MIME type checking is enforced for module scripts per HTML spec.
To Reproduce
npx create-snowpack-app dir --template @snowpack/app-template-svelte-typescript
.json
file insrc/
and import it fromindex.ts
.bundle: true
in snowpack'soptimize
confignpm run build
build/
folder and start a webserverExpected behavior
There should be no error. The .json file should import without problem, just like with
bundle: false
.Anything else?
Looks like the issue is caused by
bundle: true
.The text was updated successfully, but these errors were encountered: