-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Doesn't handle SvelteKit w/ changed base path #38
Comments
Please configure |
Process won't even start:
Even attempted moving the crate into a folder called 'subfolder' afterwards:
|
|
As I said in the OP, the rsw.toml file is exactly as it was described following the instructions in the Readme. However, here is a dump:
As for the 'rsw watch' command, it was added to the 'dev' script as described be the Readme, so it runs everytime the dev server is started. It is also the source of the error messages I've been pasting. |
Is the wasm-pack new rsw-hello
# or
rsw new rsw-hello You can execute the If there is an exception, please attach terminal all run information. |
Yes
As I said before, the file is begin generated, it's just not being found. However, I did run these commands as you indicated and got the same output as before:
|
Your description doesn't help me locate the problem. Please submit the code to the github repository, including the files in rsw-hello. |
Public repo: https://github.com/SenojLuap/demo-wasm |
Failed to load url /rsw-hello/pkg/rsw_hello.js (resolved id: /Users/lencx/github/demo-wasm/rsw-hello/pkg/rsw_hello.js). Does the file exist?
Error: Not found: /rsw-hello/pkg/rsw_hello.js
at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:395:13)
at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:236:5)
at #options.hooks.handle (/node_modules/@sveltejs/kit/src/runtime/server/index.js:41:55)
at Module.respond (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:233:40)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The request url "/Users/lencx/github/demo-wasm/rsw-hello/pkg/rsw_hello.js" is outside of Vite serving allow list.
- /Users/lencx/github/demo-wasm/src/lib
- /Users/lencx/github/demo-wasm/src/routes
- /Users/lencx/github/demo-wasm/.svelte-kit
- /Users/lencx/github/demo-wasm/src
- /Users/lencx/github/demo-wasm/node_modules
Refer to docs https://vitejs.dev/config/server-options.html#server-fs-allow for configurations and more details.
svelte config changed, restarting vite dev-server. changed file: /Users/lencx/github/demo-wasm/svelte.config.js The resource you are accessing is not allowed, you can check the documentation and just do the configuration below. https://vitejs.dev/config/server-options.html#server-fs-allow import { sveltekit } from '@sveltejs/kit/vite';
import { ViteRsw } from 'vite-plugin-rsw';
const config = {
plugins: [sveltekit(), ViteRsw()],
server: {
fs: {
// Allow serving files from one level up to the project root
allow: ['..'],
},
}
};
export default config; |
How did you get that additional output? That would have made the problem much easier to understand |
Describe the bug
When setting up the project as described in the Readme (onto a SvelteKit app), the application will not execute if the svelte config specifies an alternate base path:
svelte.config.js:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The dev server should correctly resolve the WASM module to its actual location; not adjusted by base path.
Screenshots
Not a screen shot, but here's the error I'm getting:
Note that the two URLs at the top (D:/Git/demo-wasm/rsw-hello/pkg/rsw_hello.js) are actually correct, and I've confirmed that the files actually are there.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: