Closed hansdpf closed 3 years ago
How to solve the FinalizationRegistry problem?
You reminded me that I needed to take the declaration out of it when typescript started supporting it out of the box. Just released a fix under 1.8.2
for this problem.
What about the polyfill and node.js module things?
Read the readme and try the "webpack" solution under the "Fixing common errors on web environment" section.
I was testing an upgrade to angular 12 in my project and got the following error messages:
interface FinalizationRegistry { node_modules/wasmoon/dist/types.d.ts:2:11 const FinalizationRegistry: any; 'FinalizationRegistry' was also declared here. Error: node_modules/typescript/lib/lib.esnext.weakref.d.ts:75:13 - error TS2451: Cannot redeclare block-scoped variable 'FinalizationRegistry'.
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:
./node_modules/wasmoon/dist/index.js:1507:20-33 - Error: Module not found: Error: Can't resolve 'fs' in '...\node_modules\wasmoon\dist'
How to solve the FinalizeRegistry problem?
I had this message - can't resolve fs, path, child_process.... - before, but with the "browser": {"fs": false, ...} entry in the package.json this message had disappeared; now with the upgrade test it has reappeared. Any hints?