Closed Ciantic closed 1 year ago
I think the problem is here:
And here:
Since the linkDirParent
isn't necessarily just one "/" slash behind it actually doesn't work. I will try to experiment with modifying those lines.
Imagine if you have a module that has slashes like @tanstack/solid-table
it just creates the "node_modules" but not the @tanstack
, thus the rename fails.
I've tested the same issue happens in Linux:
jarppa@Jari-Ryzen:~/projects/denotest$ deno run -A bundle.ts
✘ [ERROR] No such file or directory (os error 2): rename '/tmp/8887c786' -> '/home/jarppa/.cache/deno/deno_esbuild/@tanstack/solid-table@8.9.2_solid-js@1.7.6/node_modules/@tanstack/solid-table' [plugin deno-loader]
test.ts:3:7:
3 │ } from "npm:@tanstack/solid-table";
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: Uncaught Error: Build failed with 1 error:
test.ts:3:7: ERROR: [plugin: deno-loader] No such file or directory (os error 2): rename '/tmp/8887c786' -> '/home/jarppa/.cache/deno/deno_esbuild/@tanstack/solid-table@8.9.2_solid-js@1.7.6/node_modules/@tanstack/solid-table'
at failureErrorWithLog (file:///home/jarppa/.cache/deno/npm/registry.npmjs.org/esbuild/0.18.3/lib/main.js:1636:15)
at file:///home/jarppa/.cache/deno/npm/registry.npmjs.org/esbuild/0.18.3/lib/main.js:1048:25
at runOnEndCallbacks (file:///home/jarppa/.cache/deno/npm/registry.npmjs.org/esbuild/0.18.3/lib/main.js:1471:45)
at buildResponseToResult (file:///home/jarppa/.cache/deno/npm/registry.npmjs.org/esbuild/0.18.3/lib/main.js:1046:7)
at file:///home/jarppa/.cache/deno/npm/registry.npmjs.org/esbuild/0.18.3/lib/main.js:1075:16
at responseCallbacks.<computed> (file:///home/jarppa/.cache/deno/npm/registry.npmjs.org/esbuild/0.18.3/lib/main.js:697:9)
at handleIncomingPacket (file:///home/jarppa/.cache/deno/npm/registry.npmjs.org/esbuild/0.18.3/lib/main.js:752:9)
at Readable.readFromStdout (file:///home/jarppa/.cache/deno/npm/registry.npmjs.org/esbuild/0.18.3/lib/main.js:673:7) at Readable.emit (ext:deno_node/_stream.mjs:1852:9)
at addChunk (ext:deno_node/_stream.mjs:2874:16)
I made a pull request #73 to fix this, if someone else is blocked by this bug you can use my branch like this until this is fixed:
import { denoPlugins } from "https://cdn.jsdelivr.net/gh/Ciantic/esbuild_deno_loader/mod.ts";
Via jsdelivr.net
Fixed by #80
The gist of the issue is this:
deno-loader is trying to rename directory without creating the destination first.
If I manually make this destination directory:
C:\Users\jarip\AppData\Local\deno\deno_esbuild\@tanstack\table-core@8.8.4\node_modules\@tanstack\table-core
Then it resumes.
More error details
Reproduce
bundle.ts
test.ts
Then run
deno run -A bundle.ts