sourcing `js` file from static folder breaks on `1.0.0-next.390`
See original GitHub issueDescribe the bug
After upgrading to the latest sveltekit version (1.0.0-next.390), I am not able to source js
file from the static folder. Infact, it breaks for even css files. I believe this is due to #5648. Not sure, if there is any configuration that needs to be changed to make it work.
I am sourcing it by adding following code inside app.html
head tag.
<script src="%sveltekit.assets%/sample.js"></script>
Reproduction
Logs
Failed to load url /sample.js (resolved id: /sample.js). This file is in /public and will be copied as-is during build without going through the plugin transforms, and therefore should not be imported from source code. It can only be referenced via HTML tags.
at loadAndTransform (file:///home/projects/sveltejs-kit-template-default-5jzsnx/node_modules/vite/dist/node/chunks/dep-1513d487.js:39810:19
System Info
System:
OS: Linux 5.0 undefined
CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.10 - /bin/yarn
npm: 7.17.0 - /bin/npm
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.63
@sveltejs/kit: 1.0.0-next.390 => 1.0.0-next.390
svelte: ^3.46.0 => 3.49.0
vite: ^3.0.0 => 3.0.2
Severity
blocking an upgrade
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:10
- Comments:10 (2 by maintainers)
Top Results From Across the Web
python - Flask, Keep getting 404 serving static files using ...
Finally got it working. use flask.send_from_directory from flask import send_from_directory @app.route('/js/<path:filename>') def serve_static(filename): ...
Read more >Manage Django Static Files (Images, JS, CSS)
In your Django project directory, create a new folder named static. In the example above, the static folder is in the project folder...
Read more >sourcing `js` file from static folder breaks on `1.0.0-next.390`
After upgrading to the latest sveltekit version (1.0.0-next.390), I am not able to source js file from the static folder. Infact, it breaks...
Read more >Static files — Explore Flask 1.0 documentation
As their name suggests, static files are the files that don't change. In your average app, this includes CSS files, JavaScript files and...
Read more >Using Static Files With Flask - Python and Flask #7 - YouTube
In this video I'll show you how to use Static Files with Flask and Python.Every website online uses static files...images, css, and javascript....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry about this everyone. I’ve undone the bad PR, and this should now be fixed.
From my testing, this bug starts happening since
1.0.0-next.387
, we need to pin@sveltejs/kit
version to1.0.0-next.386
to keep the project running.