sindresorhus/tempy

Import issue with Vite

Closed this issue · 1 comments

When importing tempy from a vite project, I'm getting the following error. tempfile does not have this issue.

It seems like the node: prefix is causing a problem. Not sure if this is a vite issue or a tempy issue.

✘ [ERROR] Could not read from file: /home/brian/project/node_modules/.pnpm/node-stdlib-browser@1.2.0/node_modules/node-stdlib-browser/cjs/mock/empty.js/promises

    ../../node_modules/.pnpm/tempy@3.0.0/node_modules/tempy/index.js:2:23:
      2 │ import fsPromises from 'node:fs/promises';
        ╵                        ~~~~~~~~~~~~~~~~~~

parse_p_|end /home/brian/project/data/msci_detail_stage0.csv
2:06:13 AM [vite] error while updating dependencies:
Error: Build failed with 1 error:
../../node_modules/.pnpm/tempy@3.0.0/node_modules/tempy/index.js:2:23: ERROR: Could not read from file: /home/brian/project/node_modules/.pnpm/node-stdlib-browser@1.2.0/node_modules/node-stdlib-browser/cjs/mock/empty.js/promises
    at failureErrorWithLog (/home/brian/project/node_modules/.pnpm/esbuild@0.16.3/node_modules/esbuild/lib/main.js:1591:15)
    at /home/brian/project/node_modules/.pnpm/esbuild@0.16.3/node_modules/esbuild/lib/main.js:1047:28
    at runOnEndCallbacks (/home/brian/project/node_modules/.pnpm/esbuild@0.16.3/node_modules/esbuild/lib/main.js:1463:61)
    at buildResponseToResult (/home/brian/project/node_modules/.pnpm/esbuild@0.16.3/node_modules/esbuild/lib/main.js:1045:7)
    at /home/brian/project/node_modules/.pnpm/esbuild@0.16.3/node_modules/esbuild/lib/main.js:1157:14
    at responseCallbacks.<computed> (/home/brian/project/node_modules/.pnpm/esbuild@0.16.3/node_modules/esbuild/lib/main.js:694:9)
    at handleIncomingPacket (/home/brian/project/node_modules/.pnpm/esbuild@0.16.3/node_modules/esbuild/lib/main.js:749:9)
    at Socket.readFromStdout (/home/brian/project/node_modules/.pnpm/esbuild@0.16.3/node_modules/esbuild/lib/main.js:670:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

This is a problem with Vite. Open an issue on Vite instead.