-
Notifications
You must be signed in to change notification settings - Fork 223
[react-form] Not working with Shopify embedded app #1722
[react-form] Not working with Shopify embedded app #1722
Comments
Thanks @denisgoryaynov. Will take a look. |
@dahukish I created my project using the Shopify cli:
Maybe it should be documented somewhere or added to the template generated by shopify-cli? |
Similar issue with @shopify/react-i18n It seems to be related to Next.js
|
Seems related to #1698 cc @ismail-syed |
What @denisgoryaynov suggested is correct. You'll need to update your bundler's config to consume ESM modules ( |
@denisgoryaynov's fix worked for me. For anyone using webpack loaders instead of rules, this loader works: module.exports = {
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto",
} |
We are using @shopify/react-form with CRA. I think CRA doesn't support changing webpack config without ejecting. Can we avoid the bug using any workaround? |
I added older versions. It was solved. |
any movement on this? I created my app using create-react-app wanted to start working on translating and got this error
|
@ismail-syed We are using CRA. I think hard to modify |
I'm experiencing same error of @mubbo using library |
Workaround for CRA folks (its what I did) then set up a config-overide.js file with the following
this solved the issue for me.. not sure what it will do to my build size though.. but at least it works now. |
Yeah this a problem for CRA apps, not willing to modify our web pack or eject just for this. |
Hi folks, sorry for the delay.
Yes, we recommend apps to change their bundler configs to add support for ESM ( As first-class support for ESM ( I've open a PR in the Shopify embedded node app template repo so this works out of the box, Shopify/shopify-app-template-node#569. Once that's merged, I will close this issue. |
Overview
When trying to use @shopify/react-form I get the following error:
./node_modules/@shopify/react-form/build/esm/validation/validator.mjs Can't import the named export 'isEmpty' from non EcmaScript module (only default export is available)
The error is caused even by just importing the library:
import { useField, useForm } from '@shopify/react-form';
The text was updated successfully, but these errors were encountered: