Prettier fails to initialize

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When starting up Cursor with the extension prettier.prettier-vscode, I receive the following error under the Extension Host output:

2025-12-03 19:46:17.756 [error] Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vscode' imported from /home/lithx/.cursor/extensions/prettier.prettier-vscode-12.0.7-universal/dist/extension.js
    at Object.getPackageJSONURL (node:internal/modules/package_json_reader:266:9)
    at packageResolve (node:internal/modules/esm/resolve:779:81)
    at moduleResolve (node:internal/modules/esm/resolve:865:18)
    at defaultResolve (node:internal/modules/esm/resolve:995:11)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at resolve (data:text/javascript;base64,CglleHBvcnQgYXN5bmMgZnVuY3Rpb24gcmVzb2x2ZShzcGVjaWZpZXIsIGNvbnRleHQsIG5leHRSZXNvbHZlKSB7CgkJaWYgKHNwZWNpZmllciA9PT0gJ2ZzJykgewoJCQlyZXR1cm4gewoJCQkJZm9ybWF0OiAnYnVpbHRpbicsCgkJCQlzaG9ydENpcmN1aXQ6IHRydWUsCgkJCQl1cmw6ICdub2RlOm9yaWdpbmFsLWZzJwoJCQl9OwoJCX0KCgkJLy8gRGVmZXIgdG8gdGhlIG5leHQgaG9vayBpbiB0aGUgY2hhaW4sIHdoaWNoIHdvdWxkIGJlIHRoZQoJCS8vIE5vZGUuanMgZGVmYXVsdCByZXNvbHZlIGlmIHRoaXMgaXMgdGhlIGxhc3QgdXNlci1zcGVjaWZpZWQgbG9hZGVyLgoJCXJldHVybiBuZXh0UmVzb2x2ZShzcGVjaWZpZXIsIGNvbnRleHQpOwoJfQ==:13:10)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at resolve (/usr/share/cursor/resources/app/node_modules/import-in-the-middle/hook.js:333:26)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:240:30)

As a result, I get the following error in the UI:
“FormattingExtension ‘Prettier - Code formatter’ is configured as formatter but it cannot format ‘TypeScript’-files”

I have completely uninstalled Cursor, deleted “.cursor”, “.cursor-server”, and “.config/Cursor” folders and reinstalled, no luck.

This is not an error with prettier itself, but with the prettier.prettier-vscode plugin. I have configured prettier in a number of ways, and it makes no difference. I’m confident that prettier doesn’t even have a chance to initialize since the code that bootstraps it is what’s failing here.

Having the plugin lazy-load differently by wrapping “defaultFormatter” in a “[typescript]” block, or any other language specifier in the settings.json, results in the same bug.

There are a few bugs reported in prettier’s github that would stop it from initializing, but none with this sort of error code where “vscode” is not found, which makes me suspect that it’s cursor-specific behavior, or something that I need help on with some edge case in npm/node resolution hell and there’s some version-behavior desync, in either case I need some help lol

Steps to Reproduce

Install Cursor, install extension with identifier “prettier.prettier-vscode”, attempt to load the plugin somehow (set “defaultFormatter” and open a file of a language prettier handles like Typescript).

Expected Behavior

Prettier loads successfully.

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.46
VSCode Version: 1.105.1
Commit: ab326d0767c02fb9847b342c43ea58275c4b1680
Date: 2025-12-02T03:59:29.283Z
Electron: 37.5.1
Chromium: 138.0.7204.251
Node.js: 22.19.0
V8: 13.8.258.32-electron.0
OS: Linux x64 6.17.9-2-cachyos

Additional Information

I noticed it not working maybe a week or two ago, I just started investigating.

Installed Cursor from Arch’s AUR package cursor-bin. It’s a simple repackage of the Linux x64 .deb file (stable release), just in case that’s relevant (link).

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report.

Can you help narrow down the source of the issue?

  • Check on a clean profile: launch Cursor with a new user-data dir (e.g., cursor --user-data-dir /tmp/cursor-test), without other extensions, open an empty folder, and install only prettier.prettier-vscode. Let me know the result.
  • Temporarily try downgrading the Prettier extension to 11.x: in the Extensions panel → gear icon on Prettier → Install Another Version… → select 11.0.x. Let me know if formatting works.
  • Please attach:
  • Full snippet from Extension Host (Output: “Extension Host”) around the ERR_MODULE_NOT_FOUND error
  • Console from Help → Toggle Developer Tools → Console (screenshot/log)
  • List of installed extensions (Extensions → Installed, screenshot)
  • Does it reproduce in an empty workspace with one .ts file?
  • Exact version of the Prettier extension you tried (12.0.7-universal/11.x)

If it reproduces in the official build and on a clean profile, I’ll pass it to the team.

Alright I’ll notate what I’m doing whilst I’m doing it

  1. Uninstalled Cursor (paru -Rns cursor-bin)
  2. Deleted ~/.cursor, ~/.config/Cursor
  3. Reinstalled cursor (paru -Sau cursor-bin, updated to version 2.1.47-1)
  4. Opened with cursor –user-data-dir /tmp/cursor-test
  5. Opened new folder, entirely empty
  6. Installed Prettier (only extension, v12.0.7)
  7. Created single ts file
  8. Set Prettier to default formatter in user settings
  9. Same bugged behavior as listed in original post.

Alright, attempting to downgrade

  1. “Install specific version…” on Prettier is only listing a single version, oops
  2. Uninstall prettier.prettier-vscode
  3. Install esbenp.prettier-vscode (old package repo, v11.0.2)
  4. “Reload window” command
  5. Prettier initializes and works as intended

Getting more info on the bug, as per requested (uninstalled older version, reinstalled newer)

Closing and re-opening cursor for clean Extension Host log, which is:

2025-12-04 12:37:32.425 [info] Extension host with pid 926704 started
2025-12-04 12:37:32.425 [info] [ExtHostShellExec] Initializing terminal executor with userTerminalHint: /usr/bin/fish
2025-12-04 12:37:32.425 [info] Skipping acquiring lock for /tmp/cursor-test/User/workspaceStorage/e9355723856de8bf7017bb74633d79bf.
2025-12-04 12:37:32.501 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2025-12-04 12:37:32.518 [info] ExtensionService#_doActivateExtension anysphere.cursor-browser-extension, startup: false, activationEvent: 'onCommand:cursor-browser-extension.status'
2025-12-04 12:37:32.712 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: false, activationEvent: '*', root cause: anysphere.cursor-agent-exec
2025-12-04 12:37:32.817 [info] ExtensionService#_doActivateExtension vscode.git, startup: false, activationEvent: '*', root cause: anysphere.cursor-agent-exec
2025-12-04 12:37:32.855 [info] ExtensionService#_doActivateExtension vscode.github, startup: false, activationEvent: '*'
2025-12-04 12:37:32.946 [info] ExtensionService#_doActivateExtension anysphere.cursor-retrieval, startup: false, activationEvent: '*', root cause: anysphere.cursor-agent-exec
2025-12-04 12:37:33.125 [info] ExtensionService#_doActivateExtension anysphere.cursor-agent-exec, startup: false, activationEvent: '*'
2025-12-04 12:37:33.362 [info] ExtensionService#_doActivateExtension anysphere.cursor-mcp, startup: false, activationEvent: 'api', root cause: anysphere.cursor-agent-exec
2025-12-04 12:37:33.543 [info] Eager extensions activated
2025-12-04 12:37:33.564 [info] ExtensionService#_doActivateExtension anysphere.cursor-always-local, startup: false, activationEvent: 'onStartupFinished'
2025-12-04 12:37:33.783 [info] ExtensionService#_doActivateExtension cursor.cursor-browser-automation, startup: false, activationEvent: 'onStartupFinished'
2025-12-04 12:37:33.787 [info] ExtensionService#_doActivateExtension anysphere.cursor-browser-connect, startup: false, activationEvent: 'onStartupFinished'
2025-12-04 12:37:33.809 [info] ExtensionService#_doActivateExtension anysphere.cursor-deeplink, startup: false, activationEvent: 'onStartupFinished'
2025-12-04 12:37:33.857 [info] ExtensionService#_doActivateExtension anysphere.cursor-shadow-workspace, startup: false, activationEvent: 'onStartupFinished'
2025-12-04 12:37:33.915 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2025-12-04 12:37:33.917 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2025-12-04 12:37:33.929 [info] ExtensionService#_doActivateExtension prettier.prettier-vscode, startup: false, activationEvent: 'onStartupFinished'
2025-12-04 12:37:33.935 [error] Activating extension prettier.prettier-vscode failed due to an error:
2025-12-04 12:37:33.935 [error] Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vscode' imported from /home/lithx/.cursor/extensions/prettier.prettier-vscode-12.0.7-universal/dist/extension.js
    at Object.getPackageJSONURL (node:internal/modules/package_json_reader:266:9)
    at packageResolve (node:internal/modules/esm/resolve:779:81)
    at moduleResolve (node:internal/modules/esm/resolve:865:18)
    at defaultResolve (node:internal/modules/esm/resolve:995:11)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at resolve (data:text/javascript;base64,CglleHBvcnQgYXN5bmMgZnVuY3Rpb24gcmVzb2x2ZShzcGVjaWZpZXIsIGNvbnRleHQsIG5leHRSZXNvbHZlKSB7CgkJaWYgKHNwZWNpZmllciA9PT0gJ2ZzJykgewoJCQlyZXR1cm4gewoJCQkJZm9ybWF0OiAnYnVpbHRpbicsCgkJCQlzaG9ydENpcmN1aXQ6IHRydWUsCgkJCQl1cmw6ICdub2RlOm9yaWdpbmFsLWZzJwoJCQl9OwoJCX0KCgkJLy8gRGVmZXIgdG8gdGhlIG5leHQgaG9vayBpbiB0aGUgY2hhaW4sIHdoaWNoIHdvdWxkIGJlIHRoZQoJCS8vIE5vZGUuanMgZGVmYXVsdCByZXNvbHZlIGlmIHRoaXMgaXMgdGhlIGxhc3QgdXNlci1zcGVjaWZpZWQgbG9hZGVyLgoJCXJldHVybiBuZXh0UmVzb2x2ZShzcGVjaWZpZXIsIGNvbnRleHQpOwoJfQ==:13:10)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at resolve (/usr/share/cursor/resources/app/node_modules/import-in-the-middle/hook.js:333:26)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:240:30)
2025-12-04 12:37:39.155 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:typescript'

Devtools console:

VM4 sandbox_bundle:2 Electron Security Warning (enableBlinkFeatures) This renderer process has additional "enableBlinkFeatures"
  enabled. This exposes users of this app to some security risk. If you do not
  need this feature, you should disable it.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.
(anonymous) @ VM4 sandbox_bundle:2
workbench.desktop.main.js:542 This document requires 'TrustedScript' assignment.
(anonymous) @ workbench.desktop.main.js:542
workbench.desktop.main.js:542 The JavaScript Function constructor does not accept TrustedString arguments. See https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor for more information.
workbench.desktop.main.js:55  WARN Missing property "rpcFileLoggerFolder" in oldValue. Filling with value from initValue. Please add a migration if necessary.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-toolsai.datawrangler' wants API proposal 'debugFocus' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-vscode.vscode-copilot-data-analysis' wants API proposal 'chatVariableResolver' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-python.python' wants API proposal 'terminalShellType' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-python.vscode-python-envs' wants API proposal 'terminalShellType' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN Via 'product.json#extensionEnabledApiProposals' extension 'github.copilot-chat' wants API proposal 'chatReadonlyPromptReference' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-azuretools.vscode-azure-github-copilot' wants API proposal 'lmTools' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN Via 'product.json#extensionEnabledApiProposals' extension 'vscjava.vscode-java-pack' wants API proposal 'lmTools' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN Via 'product.json#extensionEnabledApiProposals' extension 'apidev.azure-api-center' wants API proposal 'chatParticipant' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN Via 'product.json#extensionEnabledApiProposals' extension 'apidev.azure-api-center' wants API proposal 'languageModels' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55  WARN No search provider registered for scheme: file, waiting
warn @ workbench.desktop.main.js:55
workbench.desktop.main.js:55   ERR [Extension Host] (node:926704) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `exe --trace-deprecation ...` to show where the warning was created)
error @ workbench.desktop.main.js:55
workbench.desktop.main.js:6377 [Extension Host] (node:926704) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `exe --trace-deprecation ...` to show where the warning was created)
wsf @ workbench.desktop.main.js:6377
workbench.desktop.main.js:7211 Failed to get git telemetry attributes: Error: Failed to execute git
getGitAttributes @ workbench.desktop.main.js:7211
workbench.desktop.main.js:8988 Error getting git root Error: Failed to execute git
isRepoReadyForBackgroundComposer @ workbench.desktop.main.js:8988
workbench.desktop.main.js:8988 Error getting git root Error: Failed to execute git
isRepoReadyForBackgroundComposer @ workbench.desktop.main.js:8988
workbench.desktop.main.js:6391 Activating extension 'prettier.prettier-vscode' failed: Cannot find package 'vscode' imported from /home/lithx/.cursor/extensions/prettier.prettier-vscode-12.0.7-universal/dist/extension.js.
$onExtensionActivationError @ workbench.desktop.main.js:6391
workbench.desktop.main.js:7073 [transport] Connect error in unary AI connect ConnectError: [unauthenticated] Error
    at t (workbench.desktop.main.js:6409:410319)
    at async Object.getTeamCommands (workbench.desktop.main.js:565:79973)
    at async ZIo.loadTeamCommands (workbench.desktop.main.js:8976:2992) Object
error @ workbench.desktop.main.js:7073
workbench.desktop.main.js:8976 Failed to load team commands: ConnectError: [unauthenticated] Error
    at t (workbench.desktop.main.js:6409:410319)
    at async Object.getTeamCommands (workbench.desktop.main.js:565:79973)
    at async ZIo.loadTeamCommands (workbench.desktop.main.js:8976:2992)
loadTeamCommands @ workbench.desktop.main.js:8976

List of installed extensions: prettier.prettier-vscode

Is there an update on this? It’s been more than a week with neither extension working.

I thought I’m going crazy. Hope it’s going to be fixed.

Issue made its way to the prettier repo. Conversation over there traces it back to Cursor lacking ESM support in plugins.

Link to issue, where there is a script that patches the plugin to use CJS for version 12.0.7. The pile of plugins that will migrate to ESM and break with Cursor will only grow over time, hopefully this is high up on dev’s issue list.