Open UltraCakeBakery opened 1 year ago
Created a minimal reproduction using the skeleton template here: https://github.com/UltraCakeBakery/sveltekit-symlinks-issue
Today I learned git supports symlinks yay
Edited the issue so it is now based on the minimal reproduction. I hope these changes clear things up.
Same here... No clue why it's hanging right after the "hooks". Tried different versions of node-adapter, etc.
Nothing new on this between then and now? Consider this a +1 :(
my deps:
"devDependencies": {
"@smui/button": "^7.0.0-beta.0",
"@smui/card": "^7.0.0-beta.0",
"@smui/textfield": "^7.0.0-beta.0",
"@sveltejs/adapter-node": "1.1.0",
"@sveltejs/kit": "^1.0.0",
"@tailwindcss/forms": "^0.5.3",
"@types/express": "^4.17.15",
"@types/rethinkdb": "^2.3.17",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"autoprefixer": "^10.4.13",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0",
"postcss": "^8.4.21",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"smui-theme": "^7.0.0-beta.0",
"svelte": "^3.54.0",
"svelte-check": "^2.9.2",
"tailwindcss": "^3.2.4",
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"vite": "^4.0.0"
},
"type": "module",
"dependencies": {
"express": "^4.18.2",
"rethinkdb": "^2.4.2",
"socket.io": "^4.5.4",
"socket.io-client": "^4.5.4"
}
I noticed that for some projects build would only run through if the database is up and reachable. For some reason sveltekit seems to initiate a database connection and will only finish building when that connection is successfull
I noticed that for some projects build would only run through if the database is up and reachable. For some reason sveltekit seems to initiate a database connection and will only finish building when that connection is successfull
It might be waiting endlessly on an unresolved query or never close the connection process, causing the on exit event to never be called, which in turn does not finish the build step. Not sure if that is actually how it works, but I've seen issues in the past related to database connections saying something similair. I think this is why there is that ugly line of code in the code base of svelte kit somewhere with process.exit()
and a funny comment above it.
I noticed that for some projects build would only run through if the database is up and reachable. For some reason sveltekit seems to initiate a database connection and will only finish building when that connection is successfull
It might be waiting endlessly on an unresolved query or never close the connection process, causing the on exit event to never be called, which in turn does not finish the build step. Not sure if that is actually how it works, but I've seen issues in the past related to database connections saying something similair. I think this is why there is that ugly line of code in the code base of svelte kit somewhere with
process.exit()
and a funny comment above it.
Hmm I do make a connection to my DB. Ill have a look later this week. Thx for the pointer. Dont like the setup for it anyways yet :).
You were right @UltraCakeBakery .
After refactoring my code so I don't open a connection top-level in my JS/TS code, but per-need-basis, it stopped hanging. Thanks for the help!
This is still an issue in the most recent version of SvelteKit. I have updated the reproduction to use the latest versions of SvelteKit and vite. In the new version of vite, you now also need to add the symlinks pointer location to your allow serving list.
import { sveltekit } from '@sveltejs/kit/vite';
const config = {
plugins: [sveltekit()],
server: {
fs: {
// Allow serving files from one level up to the project root
allow: ['./src-original', './static-original'],
},
},
};
export default config;
Describe the bug
I replaced the
src
andstatic
folder in my project with symlinks that point to another cloned repository folder. This causesvite build
to hang indefinitely at this step:.svelte-kit/output/server/chunks/hooks.js 0.00 KiB
Reproduction
~Not sure how to provide a reproduction due to the usage of symlinks. You can however init the skeleton project template and replace the
src
andstatic
directories with a symlinks. You should see that the step never completes like I showed in the gif / logs.~EDIT: https://github.com/UltraCakeBakery/sveltekit-symlinks-issue
Logs
And then it just hangs. It never resolves / moves on to the next fase.
System Info
Severity
blocking all usage of SvelteKit
Additional Information
None