Skip to content

Slight bug: .prettierrc.json requesting external plugin will fail with IPC error #155

Description

@GwynethLlewelyn

Symptom

While attempting to format a PHP file inside Nova, I was surprised to get an IPC error on the console instead. No formatting was applied.

I'm using the Prettier⁺ extension's 'internal' Node.js/Prettier installation, but I was still calling the PHP plugin in .prettierrc.json:

{
	"plugins": ["@prettier/plugin-php"]
}

When activating the Prettier formatting, this dumps the following to the console:

Prettier⁺[13:37:44.729000] Nova Version: 11.10
Extension Version: 3.6.2

Prettier⁺[13:37:44.741000] Prettier configuration is already sanitized.

Prettier⁺[13:37:45.832000] Resolving Prettier installation…

Prettier⁺[13:37:45.994000] node Version: v20.19.5
npm Version: 11.6.2

Prettier⁺[13:37:50.218000] Using bundled Prettier.

Prettier⁺[13:37:50.218000] Loading prettier at /Users/gwyneth/Library/Application Support/Nova/Extensions/stonerl.prettier/node_modules/prettier

Prettier⁺[13:37:50.218000] Starting Prettier service…

Prettier⁺[13:37:50.259000] Prettier service started successfully

Prettier⁺[13:38:18.139000] Resolved Syntax Key: php

Prettier⁺[13:38:18.144000] [Forced=undefined] Formatting /Users/gwyneth/SynologyDrive/Second Life/LSLscripts/Earth Globe/location.php

Prettier⁺[13:38:18.145000] Document Syntax: php

Prettier⁺[13:38:18.145000] Document URI: file:///Users/gwyneth/SynologyDrive/Second%20Life/LSLscripts/Earth%20Globe/location.php

Prettier⁺[13:38:18.147000] Prettier options: {
  "parser": "php",
  "plugins": [
    "/Users/gwyneth/Library/Application Support/Nova/Extensions/stonerl.prettier/node_modules/@prettier/plugin-php/src/index.mjs"
  ],
  "filepath": "/Users/gwyneth/SynologyDrive/Second Life/LSLscripts/Earth Globe/location.php",
  "_ignoreConfigFile": false,
  "_customConfigFile": null
}

Prettier⁺[13:38:18.154000] Prettier IPC error in format: undefined: undefined
undefined

Note 1: in spite of what it seems, the path is on a local disk, not a remotely mounted one.)

I've checked, and the extension's built-in plugin is indeed correctly installed under /Users/gwyneth/Library/Application\ Support/Nova/Extensions/stonerl.prettier/node_modules/@prettier/plugin-php/src/index.mjs.

Removing .prettierrc.json produces the expected behaviour (i.e., clean formatting without errors).

Note 2: I've also tried to configure the Prettier⁺ extension to use my own installation on disk, but this extension will get hopelessly confused with the paths in that case. This is a separate issue, though, and might not be even related to the extension itself, but rather to how I have everything confusingly installed on my side. It's on my To-Do list! 😸

Expected behavior

When the Prettier extension parses the .prettierrc.json and finds a module it already knows about, it shouldn't crash with a cryptic error on the console: either there should be a warning to delete the file, or the specific plugin should be ignored (possibly with some kind of warning).

The main reason for having an active .prettierrc.json is simply because sometimes I call my own Prettier (globally installed) on the command line as well, and when some of my code gets pushed to GitHub, it runs an action workflow, which may include prettification, and that will also require a .prettierrc.json to let Prettier figure out what additional plugins it should use.

Details

  • Nova Version: 11.10
  • Extension Version: 3.6.2

Additional context

System Information

Model Name: MacBook Pro
Model Identifier: MacBookPro18,1
Model Number: Z14V001PLSM/A
Chip: Apple M1 Pro
Total Number of Cores: 10 (8 performance and 2 efficiency)
Memory: 32 GB
System Firmware Version: 13822.61.10
OS Loader Version: 13822.61.10
Serial Number (system):
Hardware UUID:
Provisioning UDID:
Activation Lock Status: Enabled
System Version: macOS 26.2 (25C56)
Kernel Version: Darwin 25.2.0

Note that I'm not using Homebrew as a package manager, but rather MacPorts (2.11.6), which has fewer packages, but at least it has consistent dependencies for all of them (long story...).

P.S.: I've just found your fantastic 'upgraded' extension today, and was quite pleased that you added so many Prettier plugins for it, by default! That was one of the complex issues to tackle with the 'old' Prettier extension — nice work, thank you very much! 🙏

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