-
Notifications
You must be signed in to change notification settings - Fork 43
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
Sveltekit framework support #391
Comments
Yep definitely something whacky here how SvelteKit works. I will look into it |
Can you elaborate on private static final Set<String> IGNORE_WATCH = Set.of("node_modules", "build", "target", "dist", "out"); |
Svelte kit use .svelte-kit folder to do some preprocessing. |
I think it makes sense to have @fblan Ready for another great contribution :)? |
Not sure why the dev-server mode isn't working, is it due to svelte? |
@ia3andy it looks like this SVK does some crazy stuff with dynamically generating the initial JS file that it loads on /. I have never seen anything like it. I think we definitely need to try and make this work out of the box. I personally think we should ignore all "." Directories as I realized ".next" also gets generated when using NextJS |
Yeah, ok that makes sense we can give it a try |
@fblan need some help here. Can you paste here your EXACT Quinoa settings? I still can't get this to work in either Dev mode or Production mode? I am using an out of the box Svelte Kit hello world app. |
To have it working in production mode: then in svelte.config.js: import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
fallback: 'index.html' // may differ from host to host
})
}
};
export default config; and in package.json you have to add the start script: With this, the production mode should work. |
Sorry what about your Quinoa props? quarkus.quinoa.dev-server=false
quarkus.quinoa.build-dir=.svelte-kit/output
quarkus.quinoa.index-page=/
#quarkus.quinoa.enable-spa-routing=false ??? |
sorry I miss read:
|
It is strange, I have tried with quinoa 2.0.5 and dev-server=false works well, but when I try with last snapshot version it is not working anymore. I will try to see why. |
I am investigating |
OK submitted a PR that adds Svelte instructions I was able to test them myself and boil them down to minimal changes. However if you use Svelte's alternative using Vite it works out of the box with Quinoa including Hot Swapping dev mode! See: https://svelte.dev/docs/introduction#start-a-new-project-alternatives-to-sveltekit |
First of all, thanx a lot for the integration of sveltekit : 👍 I have another question : I have tried to make quinoa work with sveltekit in devserver mode.
I was able to overcome the two first issues: First issue:
- final String resourcePath = path.endsWith("/") ? path + config.indexPage : path;
+ final String resourcePath = path.endsWith("/") && !"/".equals(config.indexPage) ? path + config.indexPage : path; Second issue: But I am struggling for now with the third issue. What do you think? |
Feel free to submit a PR! |
Also if you want to try it here is a Svelte example that works out of the box including Dev mode. |
I will have look, thanx again. Thanx a lot for your help :) |
This seems like a good fix to add.
I think we should request to create a configuration in Quarkus Vertx for this. So you may configure something like this:
For the connection refused, have you tried the latest version (I added a fix recently for "connection refused") |
Describe the bug
Hi,
I have implemented quarkus quinoa with a sveltekit application that is using vite.
In production mode, everything is working perfectly, but I am not able to make it work in dev mode.
If I put properties:
I have the following error in console :
and I am redirected to quarkus default index.html.
If don't have %dev.quarkus.quinoa.index-page=/ , I have the following error:
As a workaround, I have tried to put sev-server to false but in this case the problem is that sveltekit generate some files in a sveltekit folder in sources during code generation, and these files are deteted by live reload. The compilation is continuously trigered.
I hope I didn't make a mistake, and thanx a lot for your work, this extension is very cool :)
Quinoa version
2.0.5
Quarkus version
3.1.2.Final
Build / Runtime
Vite
Package Manager
None
Steps to reproduce the behavior
clone https://github.com/fblan/test-quark/tree/main
./mvnw package
java -jar target/quarkus-app/quarkus-run.jar
open browser on http://localhost:8080
the application is displayed normally.
click on SVPOSTS and a page is displayed. This page call quarkus rest api. Everything is working perfectly.
start the dev mode:
`
Error: Not found: //
at resolve (C:/DEV/snipets/sveltekit-quark/230621-svk3/src/main/webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:430:13)
`
Expected behavior
same behavior than in production mode.
The text was updated successfully, but these errors were encountered: