Replies: 2 comments
-
|
|
Beta Was this translation helpful? Give feedback.
0 replies
-
These two statements are not generally compatible; when running in a browser, there is no access to the user's file system. Instead, look into the Web Storage API. This is different if you are developing for Electron, but that's not related to Vite. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I need to write a file in the /tmp of the user.
I develop in React for client-side.
How do I do to write in a tmp file then ?? I found nothing on google for it, does fs works if I don't use vite ?
Reproduction
https://stackblitz.com/edit/vitejs-vite-jpakmj?file=main.js,counter.js,index.html&terminal=dev
Steps to reproduce
watch in the developper console with f12 when you click on the count button
System Info
Used Package Manager
npm
Logs
promises:3 Uncaught (in promise) Error: Module "fs/promises" has been externalized for browser compatibility. Cannot access "fs/promises.access" in client code. See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
at Object.get (promises:3:11)
at TmpMan.createKeyVal (TmpMan.ts:25:6)
at Login.tsx:28:25
Validations
Beta Was this translation helpful? Give feedback.
All reactions