-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to find napi_register_module_v1 on mac m1 #20071
Comments
We want to have sharp working on Deno, it's surprising this error is raised. We need to check what mechanism sharp uses to register its native addon. |
@bartlomieju , lovell might be able to help here. |
Thanks, I'll try to dig into this problem this week. |
There is some related info here: |
@bartlomieju , there is a build of a wasm version here, which is more portable but a bit slower in case of simd (see Chart in ticket description) - it's still much better than nothing. This build is not on npm, so it's suggested to install from github repo. Can I perform the same trick with deno somehow, since this url is not an esm.sh or similar? |
Regarding the strong focus on security of Deno, the approach taken here by Bun to introduce a list of trustedDependencies, instead of |
Hey @VelinGeorgiev, @littledivy and I just did some digging into this issue. We used Deno v1.36.3 and this script: import sharp from "npm:sharp";
const semiTransparentRedPng = await sharp({
create: {
width: 48,
height: 48,
channels: 4,
background: { r: 255, g: 0, b: 0, alpha: 0.5 }
}
})
.png()
.toBuffer();
Deno.writeFileSync("semi-transparent-red.png", semiTransparentRedPng); The only problem we encountered was missing Could you provide a full reproduction on how you arrived at that error? As it stands out it appears to me that the problem is that Deno doesn't support "lifecycle" hooks as pointed out by @birkskyum. This is something we've discussed several times and haven't arrived at a good solution yet. |
there are > 3 mil. weekly downloads of sharp, almost on par with something like next.js, so this would make a very big different in terms of node compat. |
@bartlomieju I will give it a try with v1.36.3 and see if that will resolve the issue. |
Could a list of "trustedDependencies" in deno.json and package.json similar to what bun introduced be a solution for deno as well, or are there other ideas? maybe cli flags or a special syntax in import statement? It would be great as a start to at have the |
For those who haven't yet seen, the latest sharp v0.33.0 now provides full support for Deno. |
Also getting this error when using // foo.ts
import watcher from 'npm:@parcel/watcher'
await watcher.subscribe(Deno.cwd(), (_, events) => {
console.log(events)
})
setTimeout(() => {}, 60_000) deno run --allow-read --allow-ffi --watch foo.ts Try changing, saving the error: Uncaught (in promise) TypeError: Unable to find napi_register_module_v1 symbol in /Users/divyansh/Library/Caches/deno/npm/registry.npmjs.org/@parcel/watcher-darwin-arm64/2.4.1/watcher.node
at Object.Module._extensions..node (node:module:704:20)
at Module.load (node:module:597:32)
at Function.Module._load (node:module:484:12)
at Module.require (node:module:609:19)
at require (node:module:715:16)
at Object.<anonymous> (file:///Users/divyansh/Library/Caches/deno/npm/registry.npmjs.org/@parcel/watcher/2.4.1/index.js:15:13)
at Object.<anonymous> (file:///Users/divyansh/Library/Caches/deno/npm/registry.npmjs.org/@parcel/watcher/2.4.1/index.js:43:4)
at Module._compile (node:module:659:34)
at Object.Module._extensions..js (node:module:673:10)
at Module.load (node:module:597:32) |
This should be fixed in #24101, let us know if you run into more problems. |
@devsnek I just tested with https://dl.deno.land/canary/e3b2ee183bc7497ec0432bc764678f5eda6495a7/deno-aarch64-apple-darwin.zip and Watcher File change detected! Restarting!
error: Uncaught (in promise) TypeError: Unable to find register Node-API module at /Users/divyansh/Library/Caches/deno/npm/registry.npmjs.org/@parcel/watcher-darwin-arm64/2.4.1/watcher.node
at Object.Module._extensions..node (node:module:776:20)
at Module.load (node:module:654:32)
at Function.Module._load (node:module:522:12)
at Module.require (node:module:673:19)
at require (node:module:787:16)
at Object.<anonymous> (file:///Users/divyansh/Library/Caches/deno/npm/registry.npmjs.org/@parcel/watcher/2.4.1/index.js:15:13)
at Object.<anonymous> (file:///Users/divyansh/Library/Caches/deno/npm/registry.npmjs.org/@parcel/watcher/2.4.1/index.js:43:4)
at Module._compile (node:module:729:34)
at Object.Module._extensions..js (node:module:743:10)
at Module.load (node:module:654:32) Should I create a separate issue? |
Oops sorry, this got wrapped up into other |
I am having a hard time installing sharp npm module with Deno. I am currently using Deno 1.36 and mac m1 chip, also following the steps from sharp lovell/sharp#2583, but I am getting the error below.
Is this by design, or will future support be provided?
The text was updated successfully, but these errors were encountered: