Skip to content
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

Added trailing slash to Buffer import in index.ts #898

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

gboere
Copy link
Contributor

@gboere gboere commented Oct 12, 2024

As recommended by the Buffer maintainer:

To require this module explicitly, use require('buffer/') which tells the node.js module lookup algorithm (also used by browserify) to use the npm module named buffer instead of the node.js core module named buffer!

This solves a bug found bundling NSFWJS with Bun.

Build failed
1 | import { Buffer } from 'buffer';
             ^
error: No matching export in "node:buffer" for import "Buffer"
    at [path]

More information: oven-sh/bun#8683

gboere and others added 2 commits October 12, 2024 17:01
As recommended by the [Buffer maintainer](https://github.com/feross/buffer?tab=readme-ov-file#usage):

>To require this module explicitly, use require('buffer/') which tells the node.js module lookup algorithm (also used by browserify) to use the npm module named buffer instead of the node.js core module named buffer!

This solves a bug found bundling NSFWJS with Bun.

```
Build failed
1 | import { Buffer } from 'buffer';
             ^
error: No matching export in "node:buffer" for import "Buffer"
    at [path]
```

More information: oven-sh/bun#8683
Copy link
Member

@jamonholmgren jamonholmgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go. I added a comment linking to the Bun issue. @mazenchami

@GantMan GantMan merged commit 93667b0 into infinitered:master Nov 5, 2024
5 checks passed
@GantMan
Copy link
Member

GantMan commented Nov 5, 2024

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants