apollo icon indicating copy to clipboard operation
apollo copied to clipboard

gql files not resolving by babel - only in circleci

Open randyhoulahan opened this issue 5 years ago • 7 comments

Version

v4.0.0-rc.14

Reproduction link

https://circleci.com/gh/circusliving/amp/32

Steps to reproduce

the files resolve fine everywhere except in circleci's node circleci/node:latest. I have tried with and without extension gql

What is expected ?

the files to resolve

What is actually happening?

Module not found: Error: Can't resolve '../apollo/webPageByPath.gql' in 'modules'

Additional comments?

I have "graphql-tag": "^2.10.1", in my deps

This bug report is available on Nuxt community (#c249)

randyhoulahan avatar Oct 05 '19 13:10 randyhoulahan

@dohomi do you have any idea?

kieusonlam avatar Oct 19 '19 03:10 kieusonlam

Usually webpack is taking care of the graphql-loader and not babel. For me it sounds you need to add the specific webpack config but I am not sure about it as I haven't worked with circleci.

Maybe take a look at following plugin: https://github.com/gajus/babel-plugin-graphql-tag Just found a crossposting about it.

dohomi avatar Oct 20 '19 23:10 dohomi

@dohomi do you have any idea?

To work around I had to change my GQL files to js files exporting gql'' .

randyhoulahan avatar Oct 21 '19 14:10 randyhoulahan

Usually webpack is taking care of the graphql-loader and not babel. For me it sounds you need to add the specific webpack config but I am not sure about it as I haven't worked with circleci.

Maybe take a look at following plugin: https://github.com/gajus/babel-plugin-graphql-tag Just found a crossposting about it.

I will give this a try and report back.

randyhoulahan avatar Oct 21 '19 14:10 randyhoulahan

@randyhoulahan are you using TypeScript? There is a neat plugin which kind of makes this whole procedure even easier: https://www.npmjs.com/package/ts-transform-graphql-tag

dohomi avatar Oct 21 '19 14:10 dohomi

@dohomi not yet unfortunately.

randyhoulahan avatar Oct 21 '19 14:10 randyhoulahan

Hello do we have any information on this? My docker build fails on github actions.

yanovitchsky avatar Jun 23 '20 18:06 yanovitchsky