Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 17, 2025

The minimal template was failing during git commit with a module not found error for prettier-plugin-toml. The error occurred because the hardcoded path to the plugin was incorrect:

[error] Cannot find module '/nix/store/lfjxr7afcn146kfb4lkm79z0c1jndamp-prettier-plugin-toml-1.0.0/lib/node_modules/prettier-plugin-toml/lib/index.js' imported from /home/samtitle/PersonalRepos/test-std-project/noop.js

This was caused by the hardcoded path ${nixpkgs.nodePackages.prettier-plugin-toml}/lib/node_modules/prettier-plugin-toml/lib/index.js in the treefmt configuration, which no longer exists due to changes in the package structure.

Following the maintainer's suggestion to drop TOML support from prettier, this PR removes the prettier-plugin-toml dependency entirely:

  • Removed nixpkgs.nodePackages.prettier-plugin-toml from packages in both treefmt.nix and mdbook.nix
  • Removed the --plugin option and hardcoded path from prettier configuration
  • Removed *.toml from prettier's file includes list

The change preserves all other formatting functionality (nix, shell, CSS, HTML, JS, JSON, JSX, MD, MDX, SCSS, TS, YAML) while eliminating the problematic TOML formatting via prettier. TOML files will simply not be formatted automatically, but the minimal template will work without errors.

Fixes #407.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Contributor Author

Copilot AI commented Aug 17, 2025

@blaggacao 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@Copilot Copilot AI changed the title [WIP] Unable to follow minimal template due to error using prettier Remove prettier-plugin-toml dependency to fix minimal template Aug 17, 2025
@Copilot Copilot AI requested a review from blaggacao August 17, 2025 20:24
Copilot finished work on behalf of blaggacao August 17, 2025 20:24
Copy link
Collaborator

@blaggacao blaggacao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blaggacao
Copy link
Collaborator

@sstitle this looks like a correct quick fix, removing toml support. Pleas lt me know what you think of it or if you have any opinion towards alternative paths of actions (like looking for an alternative tonl formatter - suggestions?).

@blaggacao
Copy link
Collaborator

@copilot can you also remove the support for toml in treefmt, should it still exist?

Copy link
Contributor Author

Copilot AI commented Aug 17, 2025

@copilot can you also remove the support for toml in treefmt, should it still exist?

I've already removed all TOML support from treefmt in commit 6714ba8. The changes include:

  • Removed nixpkgs.nodePackages.prettier-plugin-toml from packages
  • Removed the --plugin option with hardcoded path from prettier configuration
  • Removed *.toml from prettier's includes list

There's no additional TOML formatting support remaining in treefmt that needs to be removed.

Copilot finished work on behalf of blaggacao August 17, 2025 20:50
@Copilot Copilot AI requested a review from blaggacao August 17, 2025 20:50
@sstitle
Copy link

sstitle commented Aug 17, 2025

@sstitle this looks like a correct quick fix, removing toml support. Pleas lt me know what you think of it or if you have any opinion towards alternative paths of actions (like looking for an alternative tonl formatter - suggestions?).

I'm not sure I know enough about the context of what TOML is used for in mdbook. I certainly don't think I need it. Anything that makes the minimal template functional is a suitable fix in my opinion. Thanks for your help!

@blaggacao
Copy link
Collaborator

We got a small rabbit hole between this PR and the merge button: CI is red. :-)

Let'see if Copilot can drive this.

@DockterTeagle
Copy link

perhaps failing b/c of nix version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to follow minimal template due to error using prettier
4 participants