-
Notifications
You must be signed in to change notification settings - Fork 1.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
Vite + client-preset + babelOptimizerPlugin = template is not a function #9774
Comments
I have the same issue. For now I'm using patch-package to apply the fix you suggested (replacing |
Same issue, seems to me like an issue with Babel+ESM. I tried updating @taobojlen have you submitted a PR with your change? |
Trying to fix dotansimha#9774
@n1ru4l The fix is available, can we please get this fixed? |
The pnpm patch fixes it. patches/@graphql-codegen__client-preset@4.2.6.patch
package.json
|
* Fix Babel+ESM Trying to fix #9774 * Add changeset * Update .changeset/twelve-oranges-breathe.md * Update .changeset/twelve-oranges-breathe.md --------- Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
@pksunkara @felix98765 @sebvilhelm @taobojlen Sorry for the long delay, but this is now finally addressed within #9817 Gonna cut a release in a few minutes: #10074 |
Which packages are impacted by your issue?
@graphql-codegen/client-preset
Describe the bug
When building app with vite using babelOptimizerPlugin from client-preset, building throws an error:
This happens when
package.json
type set to module.When manually changing
node_modules/@graphql-codegen/client-preset/esm/babel.js:42
template
totemplate.smart
build is successfulYour Example Website or App
https://stackblitz.com/edit/github-p5p2s9?file=vite.config.ts
Steps to Reproduce the Bug or Issue
From example:
yarn vite build
From vite react-ts template:
@graphql-codegen/cli
and@graphql-codegen/client-preset
to templateExpected behavior
Build successful
Screenshots or Videos
No response
Platform
graphql
version: 16.8.1@graphql-codegen/cli
version: 5.0.0@graphql-codegen/client-preset
version: 4.1.0Codegen Config File
Additional context
No response
The text was updated successfully, but these errors were encountered: