-
Notifications
You must be signed in to change notification settings - Fork 72
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
Module not found: Can't resolve './CartAgreements.gql' #1361
Comments
It seems to be a problem with @graphcommerce/graphql-codegen-near-operation-file' |
Sorry @luluhoc, I haven't found the time to take a look yet. |
@luluhoc I was thinking, can't you get it working with WSL2? https://code.visualstudio.com/docs/remote/wsl |
Can confirm, I had a similar error and running the following commands in the Ubuntu WSL2 sorted the issue. There's a pretty substantial performance hit but that's a known issue of WSL and not really a GraphCommerce responsibility. Commands Error (When viewing the site root or site GraphQL page)
EDIT No dice unfortunately, we just got the following error and had to run all three commands again. Once the app booted, the same CartItemsQuery.gql error was shown. @paales Or perhaps the loader for GraphQL files not being used?
|
What do you see when you run:
If you look at the yarn codegen command in the package.json, you also see |
Hey @paales , Thanks for the speedy reply again. Appreciated. Had a similar thought as yourself, had ran things that way before without the "find" snippet. No such luck. For what it's worth I can see the CartItemsQuery.graphql file has generated successfully under: Intellisense in CartItems.tsx seems to be missing a type-declaration for the .gql imports though. Unsure if that's a red herring. Output
|
Provide environment information
node 14.19.1
I have changed scripts to this as it wasn't working properly on windows.
What browser are you using? (if relevant)
CHROME
How are you deploying your application? (if relevant)
yarn dev
Describe the Bug
The gql.ts files aren't generated.
error - ./node_modules/@graphcommerce/magento-cart/components/CartAgreementsForm/CartAgreementsForm.tsx:23:0
Module not found: Can't resolve './CartAgreements.gql'
Import trace for requested module:
./node_modules/@graphcommerce/magento-cart/components/index.ts
./node_modules/@graphcommerce/magento-cart/index.ts
./lib/graphql/GraphQLProvider.tsx
./pages/_app.tsx
Expected Behavior
Generation of gql.ts files.
To Reproduce
I run it on windows
The text was updated successfully, but these errors were encountered: