-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Codegen: Couldn't resolve parser "babylon" when output file has js/jsx extension #1795
Comments
That should be pretty irrelevant - the codegen creates TypeScript, not JavaScript. You should not give the created files the extension js/x as that is just wrong. |
@phryneas Hey I also run into a parsing error when testing this tool on an larger project: This might related to prettier's ts parser not supporting some latest feature. Is it possible to provide an option to skip the prettier process? Since normally we'll have a pre-commit hook to do that job. |
Hmm, found this is dependency issue, I had typescript v4.4.4 installed, downgrade to 4.3 solved it. |
I updated the file names in the docs to As for the dependency issue: if you can create a reproduction for that, I'd like to take a look at it (but I'm swamped right now, so my feedback could take a while) - but please open a separate issue for that :) |
Should be live in https://github.com/reduxjs/redux-toolkit/releases/tag/%40rtk-query%2Fcodegen-openapi%402.0.0-alpha.0 ! Please try it out and let us know if it works. |
Prettier renamed
babylon
parser tobabel
in 1.16 and remove the deprecated one in 2.0, guess everyone is using ts as output so no one reported this issue?Just change the
EXTENSION_TO_PARSER
will solve the issue, but seems it only generates ts code (with type annotations it still throws error when trying to prettify it with babel parser), not sure why it should have this paser map.The text was updated successfully, but these errors were encountered: