-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Requires +page.{tj}s
file when using sveltekit and Houdini
#8846
Comments
Hi @lukaso thanks for writing in! I tried to reproduce this by following your reproduction instructions and I didn't encounter the mentioned error. Can you please take a look at my reproduction and point out what to change so that the error occurs? Alternatively, please share your own reproduction (e.g. via a GH repo) so that we can investigate this further. Thanks! |
OK, a little progress. I haven't been able to reproduce it with your repo, but I've been able to stop the problem with mine. I added Unfortunately, removing I don't know if that helps a little. I'll try to reproduce it, but it seems very strange. |
Once I did an |
OK, I can reproduce it with this: https://github.com/lukaso/gh-sentry-javascript-8846-sveltekit-file-not-found/tree/reproduce It appears there's a bad interaction between |
Thanks for tracking this down! I'll take a look at this next week, this week is kinda full already. Backlogged it for the moment. |
No problem. I have a workaround so it's fine for now. |
I looked into this and it seems like Houdini adds file ids to the build that didn't exist before, such as the aforementioned Consequently, the ids added by Houdini matched our filename filter, we tried to read them and... the build crashed because the file didn't exist. I opened #8881 to guard reading the file by checking for its existence. Note, I didn't find the code responsible for adding these file ids in Houdini. cc @jycouet @AlecAivazis is this intended behaviour? Are these files added so that Houdini can be used in routes without previously existing + |
+page.{tj}s
file when using sveltekit+page.{tj}s
file when using sveltekit and Houdini
Thanks for figuring this out! Really appreciated. Which version will the fix land in (if you know)? |
…mentation (#8881) In our auto instrumentation Vite plugin for SvelteKit, we read `+(page|layout)(.server).(js|ts)` files' code to determine if we should add our wrapper to the file or not. We previously didn't check for a file id's existence before reading the file if the id matched that certain pattern, wrongly assuming that these ids would always map to actually existing files. It seems like Vite plugins such as Houdini's plugin add file ids to the build for files that actually don't exist (#8846, #8854) . When our plugin's `load` hook was called for such an id, it then tried to access and read the file which caused a build error. This patch now adds a file existence guard to ensure we simply no-op for these files.
I just merged the fix so it'll go out in the next release. This will either be 7.65.1 or 7.66.0 (depending on what else we merge in). You can expect it to be released sometime this or, latest, next week. |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
7.64.0
Framework Version
Sveltekit 1.22.4
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
+layout.js
orts
toexport const ssr = false
(don't know if this is relevant to reproducing)+page.svelte
+page.ts
or a+page.js
pnpm dev
Expected Result
The project runs
Actual Result
This happens for any page in the routes, so it doesn't matter what the path is.
The text was updated successfully, but these errors were encountered: