zstd-codec icon indicating copy to clipboard operation
zstd-codec copied to clipboard

How to use with Angular / Webpack

Open jimmykane opened this issue 5 years ago • 4 comments

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'

jimmykane avatar Sep 06 '20 09:09 jimmykane

I have the same problem. @jimmykane Do you have a solution for this?

szaboge avatar Jan 07 '21 09:01 szaboge

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 .

jimmykane avatar Jan 07 '21 09:01 jimmykane

try to use https://github.com/donmccurdy/zstddec

RouR avatar Sep 21 '21 19:09 RouR

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 :/

rtista avatar Feb 09 '22 14:02 rtista