You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project, I have inadvertently imported some server-side code into my front-end code. However, the error message gives no indication of where the import has come from, meaning I have to hunt through hundreds of files to try to find the offending import statement.
Reproduction
Import code from $lib/server/... into client-side code.
Notice that the error gives no indication of where the incorrect import occurs.
Logs
10:21:01 pm [vite] Internal server error: Cannot import $lib/server/data/dataDir.ts into client-side code
at LoadPluginContext.load (file:///home/maddy/Source/Minifolio/node_modules/@sveltejs/kit/src/exports/vite/index.js:418:12)
at PluginContainer.load (file:///home/maddy/Source/Minifolio/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:49064:17)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async loadAndTransform (file:///home/maddy/Source/Minifolio/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:51869:22)
at async viteTransformMiddleware (file:///home/maddy/Source/Minifolio/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:61881:24)
I understand that I have got a bug in my code somewhere. The issue is that the error's trace-back makes it impossible to quickly determine where the bug is, which is incredibly frustrating. Showing me which file the bad import occurs within would be very helpful.
The text was updated successfully, but these errors were encountered:
Describe the bug
In my project, I have inadvertently imported some server-side code into my front-end code. However, the error message gives no indication of where the import has come from, meaning I have to hunt through hundreds of files to try to find the offending import statement.
Reproduction
$lib/server/...
into client-side code.Logs
10:21:01 pm [vite] Internal server error: Cannot import $lib/server/data/dataDir.ts into client-side code at LoadPluginContext.load (file:///home/maddy/Source/Minifolio/node_modules/@sveltejs/kit/src/exports/vite/index.js:418:12) at PluginContainer.load (file:///home/maddy/Source/Minifolio/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:49064:17) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async loadAndTransform (file:///home/maddy/Source/Minifolio/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:51869:22) at async viteTransformMiddleware (file:///home/maddy/Source/Minifolio/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:61881:24)
System Info
Severity
annoyance
Additional Information
I understand that I have got a bug in my code somewhere. The issue is that the error's trace-back makes it impossible to quickly determine where the bug is, which is incredibly frustrating. Showing me which file the bad import occurs within would be very helpful.
The text was updated successfully, but these errors were encountered: