Monorepo requires local @sveltejs/kit dependency
JannisKoeksel opened this issue Β· comments
JannisKoeksel commented
Describe the bug
In a mono repo, when using the Houdini vite build step. This bug occurs :
template:dev:
template:dev: > template@0.0.1 dev
template:dev: > vite dev
template:dev:
template:dev: π© Generating runtime...
template:dev: π‘ No operation found. If that's unexpected, please check your config.
template:dev: Forced re-optimization of dependencies
template:dev:
template:dev: VITE v5.1.3 ready in 13480 ms
template:dev:
template:dev: β Local: http://localhost:5173/
template:dev: β Network: use --host to expose
template:dev: Internal server error: Failed to load url /src/routes/+layout.js (resolved id: /src/routes/+layout.js). Does the file exist?
template:dev: at loadAndTransform (/home/projects/stackblitz-starters-vzrahe/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:53621:21)
template:dev: at async instantiateModule (/home/projects/stackblitz-starters-vzrahe/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:54643:10)
template:dev: Internal server error: Failed to load url /src/routes/+page.js (resolved id: /src/routes/+page.js). Does the file exist?
template:dev: at loadAndTransform (/home/projects/stackblitz-starters-vzrahe/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:53621:21)
template:dev: at async instantiateModule (/home/projects/stackblitz-starters-vzrahe/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:54643:10)
template:dev: Error: Failed to load url /src/routes/+layout.js (resolved id: /src/routes/+layout.js). Does the file exist?
template:dev: at loadAndTransform (/home/projects/stackblitz-starters-vzrahe/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:53621:21)
template:dev: at async instantiateModule (/home/projects/stackblitz-starters-vzrahe/node_modules/vite/dist/node/chunks/dep-stQc5rCc.js:54643:10) {
template:dev: code: 'ERR_LOAD_URL'
template:dev: }
It can be resolved by adding a
"devDependencies": {
"@sveltejs/kit": "^2.5.0"
}
to
.
βββ apps/
βββ exp/
βββ package.json
or by manually adding the page.js/ts
and layout.js/ts
files to every route.
Without the houdini()
build step, the issue does not occur even without the added dependency.
Reproduction
https://stackblitz.com/edit/houdini-bug-local-kit-dependency