timidity icon indicating copy to clipboard operation
timidity copied to clipboard

Can't resolve 'fs', brfs browserify problem?

Open mohkoma opened this issue 4 years ago • 1 comments

I'm having hard time to make this package work, I'm keep getting that fs and a modules are missing, I found similar one in the previous issues but I still can't solve it. I'm using Nuxtjs SSR/webpack and I have never used the browserify.

Is there any clear way to get it work?

image

I appreciate it and thank you in advance 🙏

mohkoma avatar Aug 18 '21 20:08 mohkoma

Some bundlers handle this automatically (example: parcel will inline fs.readFile, but esbuild requires a plugin to do so). If you can't or don't want to configure your bundler to inline this, do what I did:

npx brfs node_modules/timidity/index.js > node_modules/timidity/index.js.tmp
mv node_modules/timidity/index.js.tmp node_modules/timidity/index.js

Put that code in your build script, and then your bundler will only see a file that has already inlined that big file.

connorjclark avatar Mar 05 '22 03:03 connorjclark