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
// very complicated but basicallyimport*aswsfrom'https://github.com/websockets/ws'
Error message
After running deno run I got this:
error: Uncaught TypeError: __Buffer$.alloc is not a function
at https://esm.sh/v111/[email protected]/denonext/ws.js:2:2713
at https://esm.sh/v111/[email protected]/denonext/ws.js:2:969
at https://esm.sh/v111/[email protected]/denonext/ws.js:2:2982
at https://esm.sh/v111/[email protected]/denonext/ws.js:2:969
at https://esm.sh/v111/[email protected]/denonext/ws.js:2:4355
at https://esm.sh/v111/[email protected]/denonext/ws.js:2:969
at https://esm.sh/v111/[email protected]/denonext/ws.js:2:11129
at https://esm.sh/v111/[email protected]/denonext/ws.js:2:969
at https://esm.sh/v111/[email protected]/denonext/ws.js:8:182
Additional info
I believe this is caused by incorrect importing of the node:buffer package.
In fact, https://esm.sh/v111/[email protected]/denonext/ws.js:2:2713 links to the following source line:
Failing module
Error message
After running
deno run
I got this:Additional info
I believe this is caused by incorrect importing of the
node:buffer
package.In fact,
https://esm.sh/v111/[email protected]/denonext/ws.js:2:2713
links to the following source line:https://github.com/websockets/ws/blob/45e17acea791d865df6b255a55182e9c42e5877a/lib/constants.js#L5
This gets transpired to:
which is incorrect, as the correct import should be
import { Buffer } from "node:buffer"
.In short, it imports the default export instead of the named export
Buffer
The text was updated successfully, but these errors were encountered: