-
Notifications
You must be signed in to change notification settings - Fork 22
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
using absolute paths for importing GraphQL causes an error #79
Comments
We’ve run into this with a monorepo and cannot figure out how to get around it. Most scenarios that attempt to resolve the module path beforehand cause issues loading or transpiling. |
We encountered this too with our monorepo and ended up having to revert to |
We tried this, but the downgrade didn’t seem to help. What’s your monorepo setup? |
I also encountered this issue in a Nuxt.js project, with version 2.8.1. However, it happens only when running tests, for the tests that are mounting components that import graphql files. It does not happen when building or running the project. And even stranger, it seems to be happening only on my machine. Indeed, it does not happen when the tests are run on our CI, and it doesn't happen for a colleague on his machine. We both tried as well with a fresh clone of the project. All the tests pass for him, and I get the error. I'm on macOS 11.3.1 and my colleague on macOS 11.2.3. The CI runs on Ubuntu. I'm not expecting any help to solve an issue that happens only on my machine, but I figured it would be good to still share the information in case it can help with the general issue. |
from my stack trace this issue seems related to #78
|
The problem is this plugin doesn't take the set
|
Just to add that you can also solve this by implementing the Example: #92 (comment) |
We ended up just using |
Absolute paths configuration:
Import code:
Gives the error:
If using relative import path there is no error. e.g.
I have two projects, one using version 2.8.1 and one using 2.7.0 with the same .babelrc and jsconfig.json both cannot use absolute imports with babel-plugin-import-graphql but work using relative imports.
The text was updated successfully, but these errors were encountered: