Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prettier-plugin-glsl] error running with pnpm #10

Closed
disambiguator opened this issue Dec 26, 2022 · 2 comments
Closed

[prettier-plugin-glsl] error running with pnpm #10

disambiguator opened this issue Dec 26, 2022 · 2 comments

Comments

@disambiguator
Copy link

I recently attempted to convert a repo of mine to pnpm, but get this error when doing so.

> prettier --write shader.frag

shader.frag
[error] Couldn't resolve parser "glsl-parser"

I made a minimum reproduction case here. https://github.com/disambiguator/pnpm-prettier-glsl/tree/switch-to-pnpm

@NaridaL
Copy link
Owner

NaridaL commented Dec 26, 2022

I don't think this is an issue which can be fixed by this plugin. The plugin just relies on the default prettier plugin loading mechanism.

Have you tried the workarounds in sveltejs/prettier-plugin-svelte#155 ?

See also prettier/prettier#9167 .

In general, I've found the npm alternatives are never worth the additional hassle, even if npm isn't perfect, but of yourse YMMV 🤷 .

@disambiguator
Copy link
Author

Ah rad, you're right.This does solve it!

For posterity, changing .prettierrc.js to this fixes the problem.

module.exports = {
  overrides: [{ files: ["*.frag"], options: { parser: "glsl-parser" } }],
  plugins: ["prettier-plugin-glsl"],
};

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

No branches or pull requests

2 participants