-
Notifications
You must be signed in to change notification settings - Fork 113
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
expo-router + custom metro.config.js (resolveRequest
)
#501
Comments
resolveRequest
)
If someone comes across this, one workaround is to import from
still would be great to resolve this at |
Hi @RomanTsegelskyi, thanks for mentioning this! Unfortunately, Metro doesn't actually support ESM. It uses a Babel transformer to compile basic ESM back into CommonJS. Things should be way better once Metro "officially" supports ESM, which is currently in progress:
Until then, I'm afraid that you'd need to use ESM workarounds. But, preferably, use the actual source (since Metro transpile everything, including modules) or use a CommonJS version. Hope this helps! |
After some more experimentation, this is not |
This made it work for me! 🥳 |
Summary
It seems that
expo-router
overridesresolveRequest
inmetro.config.js
, which is needed for some packages (in my case it's graphql-requestI confirmed that without
expo-router
this works as expected, but after configuringexpo-router
, I keep gettingUnable to resolve "graphql-request" from "index.js"
. Something is going on with how metro.config is resolved, but I can't pin point whereMinimal reproducible example
metro.config.js
I tried 2 different ways
index.js
(or any other file where something is imported fromgraphql-request
)The text was updated successfully, but these errors were encountered: