Skip to content

Using Prettier Service #48

Description

@metaskills

Greetings. Was hoping this work would allow me to have Prettier formatting in my Vue's <script setup> tags. If that is what this service is not supposed to help with, apologies.

I have the volar-service-prettier package installed and my volar.config.js file appears like so:

import { volar } from "volar-service-prettier";
export default {
  services: [
    volar({
      languages: ["html", "javascript"],
    }),
  ],
};

However, I get this output in my VS Code and my package.json type is set to module.

[Warn  - 10:31:39 PM] Error [ERR_REQUIRE_ESM]: require() of ES Module /workspaces/project/volar.config.js from /home/vscode/.vscode-server/extensions/vue.volar-1.8.8/dist/server.js not supported.
Instead change the require of volar.config.js in /home/vscode/.vscode-server/extensions/vue.volar-1.8.8/dist/server.js to a dynamic import() which is available in all CommonJS modules.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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