foliojs / brotli.js

A JavaScript port of the Brotli compression algorithm, as used in WOFF2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module not found: Error: Can't resolve 'fs'

Directory opened this issue · comments

tried requiring the decompress function and got an error

ERROR in ./node_modules/brotli/dec/dictionary-browser.js 2:9-22
Module not found: Error: Can't resolve 'fs' in 'C:\redacted\node_modules\brotli\dec'
 @ ./node_modules/brotli/dec/dictionary.js 18:11-39
 @ ./node_modules/brotli/dec/decode.js 19:23-46
 @ ./node_modules/brotli/decompress.js 1:0-63
 @ ./redacted.js
 @ ./redacted.js

i am using webpack 5.

im pretty sure that #22 solved this but its not released.

i "solved" this by forcing the install from this repos master branch and not npm which is behind on release.

npm uninstall brotli
npm install --save https://github.com/foliojs/brotli.js/tarball/master

Far from ideal because now i need to do this in production and simply "npm install" ing a project into a new environment is out of the question. really wish the release was up to date

nevermind i just checked my package.json, turns out the dependencies entry for the package sources the repo endpoint and not a version so itll always install from the repo and not npm servers. yay. still not ideal though for anyone else that doesn't figure this out.

If you are using Webpack 4, you can work around this by setting config.node.fs: 'empty'.

Fixed in v1.3.3.

Fixed in v1.3.3.

not fixed! using 1.3.3 still errors for fs.