Skip to content

prettier-plugin-java not working in prettier-vscode anymore #711

Closed
@furti

Description

@furti

Since the last version update (2.6.6) prettier-plugin-java can not be loaded by prettier-vscode (https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) anymore.

The culprit seems to be this change: 2e7a828
It changed the exports field in package.json and only includes "types" and "import". But the Vscode plugin tries to load the modules using require.resolve('prettier-plugin-java').
Node throws an exception No "exports" main defined in .../node_modules/prettier-plugin-java/package.json

Changing the exports to include a require element, fixes the problem.

"exports": {
    ".": {
      "types": "./index.d.ts",
      "import": "./dist/index.js",
      "require": "./dist/index.js"
    }
  }

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