You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> deno
Deno 1.44.2
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> import "npm:contentful-management"
Uncaught TypeError: Could not find npm package 'zlib' referenced by '[email protected]'.
at async <anonymous>:1:22
>
It seems like it might be interpreting a locally-ambiguous import of zlib that should be resolved as the built-in node module (node:zlib) instead as if it's an import for an NPM module of the same name (npm:zlib), but from a quick look I wasn't able to identify where the problematic import is actually happening.
The text was updated successfully, but these errors were encountered:
jeremyBanks
changed the title
CommonJS analysis interpreting an import of Node's built-in "zlib" module as being for a "zlib" NPM module
an attempted import of Node's built-in "zlib" module is being interpreted as being for a "zlib" NPM module
Jun 19, 2024
I've tried to reduce this by using --node-modules-dir and editing it down locally. If I'm understanding correctly, these imports seem to resolve incorrectly when they're on the right-side of an export assignment.
// error: could not find package 'buffer'module.exports=require("buffer");// error: could not find package 'buffer'exports=require("buffer");// error: could not find package 'buffer'functionf(){exports=require("buffer");}//error: could not find package 'node:buffer'module.exports=require("node:buffer");
If we make the export indirect, the imports are successful and we're able to use the re-exported value successfully.
Attempting to import
npm:contentful-management
produces the following error (the same as denoland/deno_ast#227, but per denoland/deno_ast#227 (comment) it's a different underlying issue):It seems like it might be interpreting a locally-ambiguous import of
zlib
that should be resolved as the built-in node module (node:zlib
) instead as if it's an import for an NPM module of the same name (npm:zlib
), but from a quick look I wasn't able to identify where the problematic import is actually happening.The text was updated successfully, but these errors were encountered: