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
Failed to resolve import "fs/promises" from "src\routes\api\get-file-content.ts". Does the file exist?
Error: Failed to resolve import "fs/promises" from "src\routes\api\get-file-content.ts". Does the file exist?
at formatError (C:\workspace\m7d\vite\packages\vite\dist\node\server\pluginContainer.js:173:46)
at normalizeUrl (C:\workspace\m7d\vite\packages\vite\dist\node\plugins\importAnalysis.js:126:26)
at async TransformContext.transform (C:\workspace\m7d\vite\packages\vite\dist\node\plugins\importAnalysis.js:259:57)
at async Object.transform (C:\workspace\m7d\vite\packages\vite\dist\node\server\pluginContainer.js:374:30)
at async Object.transformRequest (C:\workspace\m7d\vite\packages\vite\dist\node\server\transformRequest.js:122:29)
at async instantiateModule (C:\workspace\m7d\vite\packages\vite\dist\node\ssr\ssrModuleLoader.js:44:10)
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
chaunqisun's workaround doesn't seem to work with current SvelteKit ie- adding that config to svelte.config.js > kit > vite
still cannot import fs/promises without Svite throwing JSON error
Describe the bug
fs/promises
isn't included in the array given bybuiltin-modules
package but it is inimport { builtinModules } from 'module';
:This cause Vite to give this error:
Reproduction
Use
import "fs/promises"
.I'll provide a repo in the next days.
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: