-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sveltekit): Ensure target file exists before applying auto instru…
…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.
- Loading branch information
Showing
2 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters