Skip to content
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

Trouble getting chalet to work with svelte-kit/vite #25

Open
pascalpp opened this issue Dec 2, 2021 · 2 comments
Open

Trouble getting chalet to work with svelte-kit/vite #25

pascalpp opened this issue Dec 2, 2021 · 2 comments

Comments

@pascalpp
Copy link

pascalpp commented Dec 2, 2021

Trying to figure out how to get a svelte-kit app (https://kit.svelte.dev) working in chalet. I can get the app running, but it keeps reloading. Svelte-kit apps use vite (https://vitejs.dev) for hot-module-reloading in development, and vite is trying to connect to wss://my-app.localhost:3000 and failing, so it tries reloading, infinitely. Not sure how to get this working so that chalet will forward those web socket connections through to the vite server. Here's my app config:

{
  "cwd": "/Users/pascal/Projects/my-svelte-app",
  "cmd": "npm run dev",
  "xfwd": true,
  "out": "app.log",
  "env": {
    "PATH": "[omitted]",
    "PORT": 3000
  }
}

I have self-signed SSL working, so the app loads at https://my-app.localhost, but it can't reach wss:my-app.localhost:3000

Will keep trying and report what I find but if anyone has any guidance I'd appreciate it.

@pascalpp
Copy link
Author

Follow up: I was trying again to get vite working in chalet, and I noticed that some of the example servers in the readme include --port $PORT, so I tried that with my vite app and it works! Including wss/hmr (web sockets / hot module replacement)

{
  "cwd": "/Users/pascal/Projects/vite-chalet",
  "cmd": "npm run dev -- --port $PORT",
  "env": {
    "PATH": "[omitted]"
  }
}

@pascalpp
Copy link
Author

Opened a PR to aid future travelers down this road #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant