Throwing a error: Can't resolve 'fs' in '.../node_modules/handlebars/lib'when using package that depend on handlebars.
The project built with cra reports this error, but the project built with vite does not.
I get the following error simply by using import handlebars.
Failed to compile.
Module not found: Error: Can't resolve 'fs' in 'cra-demo/node_modules/handlebars/lib'
WARNING in ./node_modules/handlebars/lib/index.js 23:38-56
require.extensions is not supported by webpack. Use a loader instead.
WARNING in ./node_modules/handlebars/lib/index.js 24:2-20
require.extensions is not supported by webpack. Use a loader instead.
WARNING in ./node_modules/handlebars/lib/index.js 25:2-20
require.extensions is not supported by webpack. Use a loader instead.
ERROR in ./node_modules/handlebars/lib/index.js 15:11-24
Module not found: Error: Can't resolve 'fs' in 'cra-demo/node_modules/handlebars/lib'
webpack compiled with 1 error and 3 warnings
No issues found.
Throwing a error:
Can't resolve 'fs' in '.../node_modules/handlebars/lib'
when using package that depend on handlebars.The project built with cra reports this error, but the project built with vite does not.
I get the following error simply by using import handlebars.
My
index.js
My
package.json