nova-prettier
nova-prettier copied to clipboard
Error: No parser could be inferred for file…
I get the following error on save in my project for any file: (May be related to #17)
[object Object] Error: No parser could be inferred for file: /Users/REDACTED/Library/Application Support/Nova/Extensions/alexanderweiss.prettier/**/*.{graphql,js,json,md,ts,tsx,yaml,yml} at normalize$1 (/Users/REDACTED/Projects/REDACTED/node_modules/prettier/index.js:11433:15) at formatWithCursor (/Users/REDACTED/Projects/REDACTED/node_modules/prettier/index.js:15034:12) at args (/Users/REDACTED/Projects/REDACTED/node_modules/prettier/index.js:51620:12) at Object.format (/Users/REDACTED/Projects/REDACTED/node_modules/prettier/index.js:51640:12) at PrettierService.format (/Users/REDACTED/Library/Application Support/Nova/Extensions/alexanderweiss.prettier/Scripts/prettier-service/prettier-service.js:51:35)
In this case, the issue appears when trying to save any changes on a .tsx
file, whether the syntax is set to TSX
or TypeScript
.
I do have a .prettierrc.js
file at the root of my project that requires an external config with a few overrides. Deleting the config file does not eliminate the error.
I also have prettier
rules set in an .eslintrc.js
config at the root of the project:
'prettier/prettier': ['error', { printWidth: 120, singleQuote: true, semi: true, trailingComma: 'none' }]
Any ideas or suggestions for resolution?
Hmmm. That first line seems strange. I'll need to look into this a little. Did you reopen the project after deleting the config file? Otherwise it may be cached. Also, do you have any prettier plugins installed in the same folder as your project?
Did you reopen the project after deleting the config file?
Restarting Nova after deleting the config results in no discernible Prettier action. I see in the extension console: Prettier service starting
, but on save I don’t get formatting or an error.
No Prettier plugins installed in the same folder as the project.
Wanted to follow up here to see if you have any suggestions for further investigation? I’m happy to help try and contribute a resolution but am not quite sure where to begin.
Hi Conor, sorry for not getting back to you. If you're still using this, how does it work with the latest version?