zstd-codec
zstd-codec copied to clipboard
How to use with Angular / Webpack
Hi there,
I have installed the module but once I try to import it I get:
ERROR in ./node_modules/zstd-codec/lib/zstd-codec-binding.js
Module not found: Error: Can't resolve 'fs' in '/Users/dimtrioskanellopoulos/Projects/track-tools/node_modules/zstd-codec/lib'
ERROR in ./node_modules/zstd-codec/lib/zstd-codec-binding.js
Module not found: Error: Can't resolve 'path' in '/Users/dimtrioskanellopoulos/Projects/track-tools/node_modules/zstd-codec/lib'
ERROR in ./node_modules/zstd-codec/lib/zstd-codec-binding-wasm.js
Module not found: Error: Can't resolve 'path' in '/Users/dimtrioskanellopoulos/Projects/track-tools/node_modules/zstd-codec/lib'
I have the same problem. @jimmykane Do you have a solution for this?
I didn't use this lib due to this. Went with pako.
On Thu, 7 Jan 2021, 10:13 Szabo Gergely Andras, [email protected] wrote:
I have the same problem. @jimmykane https://github.com/jimmykane Do you have a solution for this?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yoshihitoh/zstd-codec/issues/148#issuecomment-755988427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVX43MEH7ZSPYZLNPTPL3SYV3MZANCNFSM4Q4FJADA .
try to use https://github.com/donmccurdy/zstddec
I'm having exactly the same problem, I wanted to compress a file before sending it to a backend service so the upload is faster, but I'm having the same errors as @jimmykane :/ I've tried to add the following configuration to WebAssembly, but it's not working:
resolve: {
fallback: {
'crypto': require.resolve('crypto-browserify'),
'path': require.resolve('path-browserify'),
'stream': require.resolve('stream-browserify'),
'fs': 'empty'
}
}
@RouR 's suggestion won't work because I need to compress and not to decompress :/