HoudiniGraphql/houdini

Monorepo requires local @sveltejs/kit dependency

JannisKoeksel opened this issue ยท 1 comments

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

You can pass the projectDir value in your config file to help houdini understand where things live. The docs should have an explanation. I'm going to close this but let me know if it's still bothering you and we can figure out what the best move is