rsmbl / Resemble.js

Image analysis and comparison
http://rsmbl.github.io/Resemble.js/
MIT License
4.51k stars 425 forks source link

Error: Can't resolve 'canvas' in '~/node_modules/resemblejs' #223

Open Prathmesh-ajackus opened 1 year ago

Prathmesh-ajackus commented 1 year ago

`Error: Webpack Compilation Error ./node_modules/resemblejs/resemble.js Module not found: Error: Can't resolve 'canvas' in '~/GitHub/-automation-app/node_modules/resemblejs' resolve 'canvas' in '~/GitHub/-automation-app/node_modules/resemblejs' Parsed request is a module using description file: ~/-automation-app/node_modules/resemblejs/package.json (relative path: .) Field 'browser' doesn't contain a valid alias configuration Looked for and couldn't find the file at the following paths: [~/-automation-app/node_modules/resemblejs/node_modules] [~/-automation-app/node_modules/node_modules] [~/node_modules] [~/node_modules] [/Users//node_modules] [/Users/node_modules] [/node_modules] [~/-automation-app/node_modules/canvas] [~/-automation-app/node_modules/canvas.js] [~/-automation-app/node_modules/canvas.json] [~/-automation-app/node_modules/canvas.jsx] [~/-automation-app/node_modules/canvas.mjs] [~/-automation-app/node_modules/canvas.coffee] @ ./node_modules/resemblejs/resemble.js 67:17-34 @ ./cypress/e2e/non-parallel/siteplan/plan-image-compare.test.js

at Watching.handle [as handler] (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:212:23)
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Watching.js:99:9
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:154:20)
at Watching._done (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Watching.js:98:28)
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Watching.js:73:19
at Compiler.emitRecords (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:499:39)
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Watching.js:54:20
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:485:14
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:154:20)
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:482:27
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:2818:7
at done (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:3522:9)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:154:20)
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:464:33
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:143:16
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:143:16
at /Users/*/Library/Caches/Cypress/12.13.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:61:14
at FSReqCallback.oncomplete (node:fs:188:23)`
FrankFan commented 4 months ago

the same problem here, do you have found the answer?

krystian-panek-vmltech commented 2 months ago

@willywang , I hope you will release the fix soon ;) When could I expect to see it in NPM registry? Thanks for maintaining the excellent library, Greetings