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

fix: revert trailing slash to Buffer #910

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Johannes-Andersen
Copy link

@Johannes-Andersen Johannes-Andersen commented Nov 27, 2024

Reverts #898 (#904)

Currenrlt with the added / I am unable to use the project with ESM. Node crashes runtime with this error:

➜  git:(main) ✗ pnpm run build && pnpm run start

> [email protected] build /Users/...
> tsc


> [email protected] start /Users/...
> node dist/index.js

node:internal/modules/run_main:122
    triggerUncaughtException(
    ^

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users//node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/buffer/' is not supported resolving ES modules imported from /Users//node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/nsfwjs/dist/esm/index.js
Did you mean to import "buffer/index.js"?
    at finalizeResolution (node:internal/modules/esm/resolve:251:11)
    at moduleResolve (node:internal/modules/esm/resolve:913:10)
    at defaultResolve (node:internal/modules/esm/resolve:1037:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:650:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:599:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:582:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:241:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:132:49) {
  code: 'ERR_UNSUPPORTED_DIR_IMPORT',
  url: 'file:///Users//node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/buffer/'
}

Node.js v22.11.0

By removing this temp hack for bun, that they now have fixes, it is working again

Until this is merged I just downgraded to "nsfwjs": "4.2.0". Will run outdated version until this is released :D

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.

1 participant