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

Got MIME type errors in a JS module which runs on localehost in strict mode w/o probs #2547

Closed
BarbWire-1 opened this issue May 31, 2023 · 2 comments

Comments

@BarbWire-1
Copy link

link to project

@fvsch
Copy link
Contributor

fvsch commented May 31, 2023

Hi @BarbWire-1,

Our JavaScript starter does not support arbitrary HTML such <script src="…"></script> tags in the index.html file.

It automatically builds index.js and its dependencies and injects the result in the HTML page.

Things like using fetch to request project files (such as HTML templates for components) over HTTP is probably not going to work either in the JavaScript starter.

You can use the HTML/CSS/JS starter as a base instead. It uses Service Workers to serve project files over HTTP, which should work better with the way you're loading code. I reuploaded your project files in a HTML/CSS/JS project and it seems to work, after fixing some incorrect URLs in your files (beware of capitalization: if your folder is named Component1, the URL should not have component1):
https://stackblitz.com/edit/web-platform-i78bj2

@BarbWire-1
Copy link
Author

BarbWire-1 commented May 31, 2023

Thanks so much!!! You made me day.
Also for finding my "capital" mistakes ;) Now I know this structure only works if bundled (?) or using sw, as the css variables don't get applied in my corrected copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants