HoudiniGraphql / houdini

The disappearing GraphQL client

Home Page:http://www.houdinigraphql.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monorepo requires local @sveltejs/kit dependency

JannisKoeksel opened this issue Β· 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