Skip to content

Broken exports in node mjs #30

@posva

Description

@posva

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions