You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for this very useful plugin!
I've recently migrated a project to @apollo/client v3 and encountered an error with the way this plugin seems to remove the import statements.
Console error:
path/to/app/node_modules/@apollo/client/core/index.js 16:9
Module parse failed: Export 'gql' is not defined (16:9)
File was processed with these loaders:
* ../../node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| enableExperimentalFragmentVariables = gql.enableExperimentalFragmentVariables,
| disableExperimentalFragmentVariables = gql.disableExperimentalFragmentVariables;
> export { gql };
File related to the above error: (node_modules/@apollo/client/core/index.js)
As you can see, @apollo/client is importing gql from graphql-tag and assigning a few vars before exporting it. This plugin seems to remove the import statement, which leads to the above error.
I was able to resolve this by setting importSources: ["@apollo/client"] via the configuration. However, this is a bad user experience for migrating projects because they would have to change all imports at once and I think, this plugin shouldn't touch any files located in node_modules. I propose, we exclude the node_modules directory.
What do you think? Do you have a better fix in mind?
The text was updated successfully, but these errors were encountered:
Hi there,
thanks for this very useful plugin!
I've recently migrated a project to
@apollo/client
v3 and encountered an error with the way this plugin seems to remove the import statements.Console error:
File related to the above error: (
node_modules/@apollo/client/core/index.js
)As you can see,
@apollo/client
is importing gql fromgraphql-tag
and assigning a few vars before exporting it. This plugin seems to remove the import statement, which leads to the above error.I was able to resolve this by setting
importSources: ["@apollo/client"]
via the configuration. However, this is a bad user experience for migrating projects because they would have to change all imports at once and I think, this plugin shouldn't touch any files located innode_modules
. I propose, we exclude thenode_modules
directory.What do you think? Do you have a better fix in mind?
The text was updated successfully, but these errors were encountered: