D
Deno

help

Running esbuild with esbuild_deno_loader

IioB3/3/2023
I've spent probably four or five hours trying to track down this issue, to the point where I actually started tweaking and rebuilding old versions of esbuild to try and reproduce this bug without the help of a plugin. I have no idea. I want to find what version this started happening in to file a bug report (because I think it's an esbuild issue), but I haven't had the time to do that. Here is the reproc code (it only errors with wasm):
import * as esbuild from "https://deno.land/x/esbuild@v0.15.10/wasm.js";
import { denoPlugin } from "https://deno.land/x/esbuild_deno_loader@0.6.0/mod.ts";

const result = await esbuild.build({
plugins: [denoPlugin()],
entryPoints: {
"test": new URL("./link-to-any-deno-file.ts", import.meta.url).href
},
outdir: ".",
bundle: true,
write: false,
format: "esm",
});

esbuild.stop();
import * as esbuild from "https://deno.land/x/esbuild@v0.15.10/wasm.js";
import { denoPlugin } from "https://deno.land/x/esbuild_deno_loader@0.6.0/mod.ts";

const result = await esbuild.build({
plugins: [denoPlugin()],
entryPoints: {
"test": new URL("./link-to-any-deno-file.ts", import.meta.url).href
},
outdir: ".",
bundle: true,
write: false,
format: "esm",
});

esbuild.stop();
Running this results in:
error: Cannot read file "Users/iob/Desktop/test/link-to-any-deno-file.ts": not implemented on js
error: Cannot read file "Users/iob/Desktop/test/link-to-any-deno-file.ts": not implemented on js
This is blocking any upgrade of the esbuild dependency for fresh.
KKyleJune3/4/2023
When I use esbuild, i just use a single entry point of "app.tsx" where it resolves to the app.tsx file in my current directory. So I have entryPoints:["app.tsx"]. I also specify the working directory with the absWorkingDir set to Deno.cwd(). Maybe it would work if you set the absWorkingDir and set entryPoints to {test:"./link-to-andy-deno-file.ts"} using a relative path string instead of a URL object. Oh also I don't use wasm. I just noticed you said you only have problems with wasm. You could still try using strings instead of URL objects to see if that would work with wasm. Maybe it's an issue related to handling of the URL objects.
IioB3/4/2023
the reason this is set up this way is because this is how it has to be set up for fresh I wouldn't use esbuild this way for personal projects I imagine that's why I'm the first person as far as I can tell to encounter this The error message is super unclear though and I'm not even sure how it could happen Where does the "not implemented on js" error message come from? it's not anywhere in esbuild's source code nor in the esbuild_deno_loader source code I realize now that it could be a dependency of esbuild and that would probably explain why I can't find the source of this error

Looking for more? Join the community!

Recommended Posts
`fetch` request always fails onceHello, I got a script containing a `fetch` request. Once in a while, it throws the `connection closeSequentially write to TPC connectionHey, I experience errors when multiple async functions write to a TCP (`Deno.Conn`) connection. How I'd like to change the background colour of the `body` element in Fresh. How do I do that simply?(see title)Deno process watcher. How?This code when compile, runs a simple http server. ```ts import { serve } from "https://deno.land/stmonaco-editor on freshHello. First of all, I am a newbie in web development. I played around with Deno for a while. So I tdeno in Dockerfilei have successfully installed deno with theese commands: ``` # install denojs RUN curl -fsSL https:could not find npm package forI'm trying to make Hardhat CLI work with Deno but I stumbled upon this error which comes from Deno: Microsoft Transact SQLIs there official Deno driver for this or a recommended way?Remove std/node, it was merged into Deno itself (#3206)This used to work, but now it doesn't. Where do you show examples of where this was moved to and howFFI Difference between buffer and pointerI’ve been using interchangeably `Deno.UnsafePointer.of(new Uint8Array())` with type `pointer` and `nDetecting invalid JS stringsIs there any built-in way to "detect" invalid strings? Here's an example: ```ts // this is an invaError connecting to MongoDB AtlasHello, I'm trying to connect to MongoDB Atlas via `mongoose` (`npm:mongoose`) but encountered the fointeract with deno Extension at runtimeIs there any way to interact with an extension at code execution? I need to pass a pointer from my rAny good way to modify remote url file and debug it?For example, I'm using `import server "https://deno.land/x/ultra@v2.1.7/server.ts"` I want to modifyCache related headers not included in deno deploy for static file servingI have a hello world level static site using `serveDir`. When I run the site locally I see that WeakError with relativ import path after "deno install"Is it possible that imports in deno.json are ignored after "deno install"? ```bash deno run ./my-Run examples on WindowsAnyone know how to run the `Piping to files` example on Windows? https://deno.land/manual@v1.30.3/exPython alternative to ctypes, can't figure how to convert a codeHello, I am trying to convert a Python ctypes code to Deno using FFI, but can't know why its not woSuggestions for minimal JSX rendering?Any suggestions for rendering jsx to a string (or ideally a stream), in the most minimal manner fromDeno.run Strange IssueI use `Deno.run` + stdout/signals/etc a lot, but this behavior is beyond my current debugging abilit