stackblitz / core

Online IDE powered by Visual Studio Code ⚑️
https://stackblitz.com
MIT License
10.19k stars 886 forks source link

Adding scripts to html using Javascript doesn't work #1579

Open quinton-ashley opened 2 years ago

quinton-ashley commented 2 years ago

Describe the bug

This project based on the old stackblitz HTTP server nodejs template works kind of https://stackblitz.com/edit/quintos-template but even though changes to the server are reflected when the server is run again, changes to the "client side" files are not. (as described in stackblitz/webcontainer-core#209)

I noticed the Javascript stackblitz template may be better suited for this but seems as of now that it is not. https://stackblitz.com/edit/quintos-template-test0 I really like the section in the sidebar where it lets you download dependencies super easily though! Great work so far! Hope this problem can get solved, I want to use Stackblitz with all my students. πŸ˜„

Link to the blitz that caused the error

https://stackblitz.com/edit/quintos-template-test0

Steps to reproduce

Go to page, receive error:

quintos-template-test0.stackblitz.io/:1 Refused to execute script from 'https://quintos-template-test0.stackblitz.io/load.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Expected behavior

Scripts added to the HTML file should be run.

Also minor bug, I updated my package quintos by deleting it and loading it again and the version number didn't change. Says 1.6.54 should be 1.6.55.

Screenshots

No response

Platform

macOS Big Sur and Chrome on Apple M1 chip Macbook Air 2021

Additional context

No response

quinton-ashley commented 2 years ago

I am using the Apple M1 chip Macbook Air 2021

quinton-ashley commented 2 years ago

I still get this same error. It's been a whole month.

d3lm commented 2 years ago

Hi πŸ‘‹ I suggest you give WebContainer a try and you can start here https://node.new. This will scaffold a new barebone node project and you get a terminal, and can run almost any node program.

vatomicgreg commented 1 year ago

Files are sometimes served with the wrong mime type.

This works: https://stackblitz.com/edit/es-module This doesn't: https://stackblitz.com/edit/js-t1j9zw

But they are the same.