Closed mlh-trungdq closed 4 years ago
no fix, just a workaround, define fs
, path
and crypto
as externals in your module bundler (i.e. webpack).
Here's an example on how to do it in webpack configuration file:
module.exports = {
// ....
externals: {
fs: "fs",
path: "path",
crypto: "crypto"
},
// ....
}
ThankYou. I love it!!
For nuxtJS in a nuxt.config.js file, add this similar piece of text:
// nuxt.config.js
export default {
...
build: {
...
extend: function (config, {isDev, isClient}) {
config.node = {
fs: "empty"
};
}
},
...
};
Hi there! Thanks for the lib :)
I just added the lib to my project and I'm facing this issue. IMO this issue should be fixed at the library level rather than on the consumer Webpack config, otherwise, every single user will have to trick their configs in order to make it work, and in some cases that is not as simple.
Perhaps adding the external into the Rollout config? Or find out a different way, what do you think?
本地项目连接的测试环境上传头像转换没问题,打包上测试后上传头像一上传整个页面就卡住崩了,也不报错,是什么原因呢
Thank you for the tool! I had an error adding the library to my component. "_ERROR in ./node_modules/heic2any/dist/index.js Module not found: Error: Can't resolve 'fs' in 'D:\projects\myproject\nodemodules\heic2any\dist'"
Can you suggest how to fix it?