-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: MIME Type Error When Deploying Storybook with Vue3 and Vite #21388
Comments
OK, I found a solution that helped me, I will leave a comment here cause someone can benefit from it in the future. I am still not sure what caused this problem, so I will not close this issue yet. My assumption is that this has something to do with how viteFinal resolves extensions in main.ts file. The problem occurred when storybook tried to access some My solution was to add this into my Web.config file
More about why I needed to first remove and than add fileExtension you can read in the answer Eric Barr provided: |
@nebojsa91markovic how are you opening the built files? You mention IIS. Does storybook load correctly if you use something like |
Yes, storybook can run locally, so it is connected to do with IIS definitely. But I would not say it's only because of the IIS, because the same IIS version used to work, as I mention above with Vue2 + babel + Storybook 6.4. @shilman I written an article that might provide more info about this issue that I had and how I workaround it. If I can help somehow please don't hesitate to ask. |
One change between 6.4 and 7.0 is the inclusion of |
When I tried to deploy this to Chromatic, everything is working correctly. So probably it is only connected to IIS8^ but I would not exclude completely builder_vite Do you know if can confirm this somehow? |
I suppose you could create another website that uses ES modules and try loading that up in IIS8? |
It looks like an http server configuration issue, please see #20157 (comment). |
We're also seeing this issue when trying to deploy to AWS Amplify. We're in touch with AWS and they're looking into this, just in case anyone else is using the same deployment mechanism! |
@siggerzz Did you ever find a solution to this issue with Amplify? |
Hi there! Thank you for opening this issue, but it has been marked as |
I'm afraid we need to close this issue for now, since we can't take any action without the requested reproduction or additional information. But please don't hesitate to open a new issue if the problem persists – we're always happy to help. Thanks so much for your understanding. |
Describe the bug
I migrated our project to Vue 3 Vite and Storybook v7.0.0-beta.60, and I am trying to publish static storybook web from inside of
./dist
folder built usingvite build
.When I try to access my storybook page as e.g.
http://mywebsite.com/storybook
I get this error in console:Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
Previously, before migrating I was able to do the same using Vue 2 + babel + Storybook 6.4.0
To Reproduce
I run script
npm run build
- script looks like this:"build": "npm run build-web && npm run build-storybook", "build-web": "vite build", "build-storybook": "build:storybook --output-dir ./dist/storybook",
From inside of main.ts from .storybook, my config file contains this portion:
"framework": { "name": "@storybook/vue3-vite", "options": {} }, "core": { "builder": "@storybook/builder-vite", },
System
Additional context
No response
The text was updated successfully, but these errors were encountered: