nsfwjs icon indicating copy to clipboard operation
nsfwjs copied to clipboard

Raising multiple "Breaking Change" errors when installing nsfwjs in React Js

Open Yawan-1 opened this issue 1 year ago • 3 comments

I am trying to install nsfwjs in my react app (just created to test nsfwjs) and It is showing bunch of errors right after when I run npm start.

Errors like

Can't resolve 'assert' in **/path/project/**

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
       
If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "buffer": require.resolve("buffer/") }'
        - install 'buffer'
 
If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
        - install 'stream-browserify'

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
        - install 'util'

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'


If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "zlib": require.resolve("browserify-zlib") }'
        - install 'browserify-zlib'

I have no idea why it is showing these errors. Do I have to install these recommended libraries/packages separately?

My react version is 18.2.0

Yawan-1 avatar Mar 13 '23 11:03 Yawan-1

I'm off this week. @cdanwards - can you take a quick look at this if you get any time this week?

GantMan avatar Mar 13 '23 13:03 GantMan

@Yawan-1 I'm going to take a look at this! How did you create the app? (Some users have had issues with vite)

cdanwards avatar Mar 14 '23 14:03 cdanwards

I didn't create the app using vite but with npx create-react-app. @cdanwards

Yawan-1 avatar Mar 14 '23 17:03 Yawan-1