Skip to content

Error: Module "fs/promises" has been externalized for browser compatibility. #16236

Closed

Description

@njaros

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

slackblitz.com

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

Activity

  1. bolt-new-by-stackblitz commented on Mar 22, 2024

    @bolt-new-by-stackblitz
  2. locked and limited conversation to collaborators on Mar 22, 2024
  3. converted this issue into a discussion #16239 on Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions