Skip to content

Error: No "exports" main defined in /.../package.json #41

@ericclemmons

Description

@ericclemmons

This may be a playwright issue, but I discovered that running npx playwright test would get this error if it did not have a default exports:

Error: No "exports" main defined in /.../package.json

Adding 1 line fixed it, so I'm wondering if this should be the default (heh :D):

  "exports": {
    ".": {
+     "default": "./dist/index.js",
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    }
  },
  "scripts": {
    "build": "zshy",
    "lint": "tsc --noEmit"
  }
}

I know I can auto-generation of exports and do it myself, but I'm wondering if this should be default behavior.

https://github.com/colinhacks/zshy?tab=readme-ov-file#can-i-prevent-zshy-from-modifying-my-packagejson

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions