The current exports are invalid because the package is a commonjs (default type in package.json) but the import field of exports points to a file that uses modules and has a js extension. Using an mjs extension should be enough to fix this.
Here is how to reproduce the issue:
package.json
{
"name": "brotli-test",
"version": "0.0.0",
"type": "module",
"private": true,
"main": "index.mjs",
"scripts": {
"start": "node index.mjs"
},
"dependencies": {
"brotli-wasm": "^2.0.1"
}
}
index.mjs
import { compress } from 'brotli-wasm'
run npm start
The current exports are invalid because the package is a commonjs (default
typein package.json) but theimportfield ofexportspoints to a file that uses modules and has ajsextension. Using anmjsextension should be enough to fix this.Here is how to reproduce the issue:
package.json
{ "name": "brotli-test", "version": "0.0.0", "type": "module", "private": true, "main": "index.mjs", "scripts": { "start": "node index.mjs" }, "dependencies": { "brotli-wasm": "^2.0.1" } }index.mjs
run
npm start