-
Notifications
You must be signed in to change notification settings - Fork 554
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
ERR_UNSUPPORTED_DIR_IMPORT when used in esm project #904
Comments
Sorry, you are missing the point. The problem is, the added "slash" in the v4.2.1 broke the ESM version of the library. See this example: https://github.com/asokani/nsfwjs-esm
However, I cannot reopen this issue - there's just a "comment" button. Can you @mazenchami please recheck? |
Having the same problem. The line needs to import from Or just |
The issue related to the bun runtime seems to have been fixed (oven-sh/bun#8683). It should be safe to remove the trailing slash now if that's causing any issues for others. Also in my testing, I couldn't reproduce any issue related to this on bun. Maybe someone can provide an example to reproduce this on bun if it still exists without the trailing slash. Also, since |
4.2.1 is not usable because of infinitered/nsfwjs#904
* fix: punycode.js が使用されていない場所がある問題 * fix: use punycode/punycode.js on backend * fix: use punycode/punycode.es6.js on backend * fix: d.ts missing declare keyword * chore: don't use punycode.js on backend * update pnpm-lock.yaml * chore: remove punycode.d.ts * chore: use punycode.js instead of punycode npm package * chore: bump psl to 1.15.0 * chore: bump nsfwjs to 4.2.0 4.2.1 is not usable because of infinitered/nsfwjs#904 * chore: prevent loading node-fetch from tensorflow * chore: DOMWindow['document'] => Document IDK why DOMWindow['document'] fails, but might be related to tsc internal complexity limit * fix: disable --trace-deprecation --------- Co-authored-by: syuilo <[email protected]>
* fix: punycode.js が使用されていない場所がある問題 * fix: use punycode/punycode.js on backend * fix: use punycode/punycode.es6.js on backend * fix: d.ts missing declare keyword * chore: don't use punycode.js on backend * update pnpm-lock.yaml * chore: remove punycode.d.ts * chore: use punycode.js instead of punycode npm package * chore: bump psl to 1.15.0 * chore: bump nsfwjs to 4.2.0 4.2.1 is not usable because of infinitered/nsfwjs#904 * chore: prevent loading node-fetch from tensorflow * chore: DOMWindow['document'] => Document IDK why DOMWindow['document'] fails, but might be related to tsc internal complexity limit * fix: disable --trace-deprecation --------- Co-authored-by: syuilo <[email protected]>
I’m unable to run my ESM project with this library due to the following error:
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/app/node_modules/buffer/' is not supported resolving ES modules imported from /app/node_modules/nsfwjs/dist/esm/index.js
The issue is caused by this line in dist/esm/index.js
It can be fixed like this:
It might be possible to address this here:
nsfwjs/src/index.ts
Line 3 in 836ff6b
The text was updated successfully, but these errors were encountered: