project-serum / serum-ts

Project Serum TypeScript monorepo
https://projectserum.com
Apache License 2.0
270 stars 245 forks source link

Module not found: Error: Can't resolve 'os' in '\node_modules\@project-serum\anchor\dist\esm' #240

Closed catalin560 closed 2 years ago

catalin560 commented 2 years ago
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
        - install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "os": false }

the problem repeats itself for the following dependencies: path-browserify, process, assert, fs

nothing that I've tried so far seems to work, any solutions?