-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Babel plugin does not run with Typescript #1590
Comments
Same issue with |
For my issue, I solved it by setting This is the minimal tsconfig that worked in a test repo: {
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"module": "es6",
"moduleResolution": "node",
"jsx": "preserve"
}
} For my issue, this makes obvious sense because the I'm not sure if it will also address your issue with graphql but worth a shot. |
@cdock1029 's solution should work, removed the bug flag. As this ain't no bug, just misconfiguration |
Yep, this was a misconfiguration issue to do with interaction between Typescript and Babel. As @cdock1029 suggests the solution is to prevent Typescript from transpilation, and leave it to Babel. |
🐛 bug report
The relay babel plugin does not run on outputted javascript when using Typescript. It appears that something is happening, since Parcel will complain about missing plugins; but the
graphql
template tags that relay strips are still present in the output.🎛 Configuration (.babelrc, package.json, cli command)
.babelrc
(see gist for remaining config)
🤔 Expected Behavior
The page should render the error output from the
QueryRenderer
.😯 Current Behavior
This invariant is hit because the plugin has not run to strip out the template tags.
💁 Possible Solution
If I switch away from Typescript to regular JSX files, the babel plugin operates as expected.
It would be good to get some more transparency/documentation about how Parcel is bundling things together. Currently I do not really know how to go about debugging this issue.
🔦 Context
I am trying to bootstrap a project that uses Typescript and Relay. I attempted to do this by first getting Typescript going (very easy 💯 ) then running through the Relay Quick Start Guide.
💻 Code Sample
https://gist.github.com/mathewbyrne/9d792f20da06cb4604c354091297dd70
🌍 Your Environment
The text was updated successfully, but these errors were encountered: