-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
important for freshIssues that are important for Fresh usersIssues that are important for Fresh users
Description
The npm package ws has an optional peerDependency on bufferutil. In their code they check for this via:
if (!process.env.WS_NO_BUFFER_UTIL) {
try {
const bufferUtil = require('bufferutil');
// ...
} catch (e) {
// Continue regardless of the error.
}
}But since the @deno/loader tries to initialize all packages up front it will error out.
Steps to reproduce
- Clone https://github.com/marvinhagemeister/deno-loader-optional-bug
- Run
deno install - Run
deno run -A main.ts
Output:
$ deno run -A main.ts
error: Uncaught (in promise) Error: Could not find package 'bufferutil' from referrer 'file:///Users/marvinhagemeister/Library/Caches/deno/npm/registry.npmjs.org/ws/8.18.3/node_modules/ws/lib/buffer-util.js' (ws@8.18.3).
const ret = new Error(getStringFromWasm0(arg0, arg1));
^
at __wbindgen_error_new (https://jsr.io/@deno/loader/0.1.3/src/lib/rs_lib.internal.js:978:15)
at <anonymous> (wasm://wasm/013c5e56:1:4115117)
at <anonymous> (wasm://wasm/013c5e56:1:3914089)
at <anonymous> (wasm://wasm/013c5e56:1:3978417)
at DenoLoader.resolve (https://jsr.io/@deno/loader/0.1.3/src/lib/rs_lib.internal.js:318:24)
at Loader.resolve (https://jsr.io/@deno/loader/0.1.3/src/mod.ts:194:31)
at file:///Users/marvinhagemeister/dev/test/deno-loader-optional/main.ts:14:31Original reported at denoland/fresh#3078
Metadata
Metadata
Assignees
Labels
important for freshIssues that are important for Fresh usersIssues that are important for Fresh users