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
Hello! For reasons outside of our control, we require our SvelteKit app to work over the file:// protocol. The goal is to build the app, transfer files to client machines, and have them use it by launching index.html.
The biggest obstacle so far is that browsers refuse to load ESM scripts over file:// URLs, which means all JS is being blocked. It looks like Vite can be configured to target es5, but that also would remove modern JS syntax like let and const, which is not desired. I also looked into legacy builds, but support for them is currently an open issue.
I have prepared a demo repo configured to build the Svelte Kit demo app with the static adapter. You can try it yourself by building it and pointing your browser directly to build/index.html. You will get a blank screen and errors in the console:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello! For reasons outside of our control, we require our SvelteKit app to work over the
file://
protocol. The goal is to build the app, transfer files to client machines, and have them use it by launchingindex.html
.The biggest obstacle so far is that browsers refuse to load ESM scripts over
file://
URLs, which means all JS is being blocked. It looks like Vite can be configured to targetes5
, but that also would remove modern JS syntax likelet
andconst
, which is not desired. I also looked into legacy builds, but support for them is currently an open issue.I have prepared a demo repo configured to build the Svelte Kit demo app with the static adapter. You can try it yourself by building it and pointing your browser directly to
build/index.html
. You will get a blank screen and errors in the console:Beta Was this translation helpful? Give feedback.
All reactions