-
Notifications
You must be signed in to change notification settings - Fork 626
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
Unable to resolve modules on latest Expo with Metro web #1003
Comments
Was unable to replicate this, try reinstalling
I don't think using this package ( In this case, React Native does support |
@huntie There's been lots of work in that area - maybe we've intentionally changed something there, or there's been a regression? |
I also get this new error after upgrading expo 49:
|
This could solve: add support for config.resolver.sourceExts.push("mjs"); |
@younes0 thank you!! adding I was seeing this with Web Bundling failed 5439ms
Unable to resolve "stylis" from "node_modules/styled-components/dist/styled-components.browser.esm.js" |
Indeed, I can confirm adding this line solved the problem. Thank you @younes0 ! |
@younes0 the 👑 🙏 |
@younes0 thanks for this. Web Bundling failed 2164ms |
@younes0 thanks a lot. It seemed to solve the problem 😄 |
I have the same issue as @DAVIS-PYTH, but adding I still get this when building for web (works fine on mobile):
|
This turned out to be a mysterious issue related to using |
|
Thanks @robhogan. I’m also seeing this error when hot-reloading a project file, when a web client is connected. No error with iOS or Android clients. The error isn’t fatal, everything still seems to work. It’s just clutter in the console output. |
Issue on Web build: Unable to resolve "graphql" from "node_modules/graphql-tag/lib/index.js" Adding this line of code solve the problem. Thank you |
this fixed to me metro.config.js
|
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
When running npx expo start, i got the following error when trying to open web:
Web Bundling failed 20984ms
Unable to resolve "graphql" from "node_modules/@aws-amplify/api-graphql/lib-esm/GraphQLAPI.js"
Web Bundling failed 114456ms
Unable to resolve "process" from "node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js"
Metro error: Unable to resolve module process from /home/d/expo49/node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js: process could not be found within the project or in these directories:
On mobile (Expo GO) it works as expected and doesn't show the error. It probably comes from the metro for web.
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.clone https://github.com/EvanBacon/expo-router-instagram-layout then install amplify auth:
yarn add aws-amplify amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage
then run npx expo
What is the expected behavior?
To fix the error when accessing on web (on mobile it works well)
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
const { getDefaultConfig } = require("expo/metro-config");
const config = getDefaultConfig(__dirname, {
isCSSEnabled: true,
});
config.resolver.sourceExts.push("svg");
config.resolver.assetExts = config.resolver.assetExts.filter(
(ext) => !config.resolver.sourceExts.includes(ext)
);
config.transformer.babelTransformerPath = require.resolve(
"./metro.transformer.js"
);
module.exports = config;
my environment:
System:
OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
CPU: (4) x64 Intel(R) Pentium(R) Gold 7505 @ 2.00GHz
Memory: 1.99 GB / 3.73 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 19.3.0 - ~/.nvm/versions/node/v19.3.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v19.3.0/bin/yarn
npm: 9.3.0 - ~/.nvm/versions/node/v19.3.0/bin/npm
npmPackages:
@babel/core: ^7.19.3 => 7.21.8
@babel/plugin-proposal-export-namespace-from: ^7.18.9 => 7.18.9
@react-native-async-storage/async-storage: ^1.18.2 => 1.18.2
@react-native-community/netinfo: ^9.3.10 => 9.3.10
@types/react: ^18.2.6 => 18.2.8
HelloWorld: 0.0.1
amazon-cognito-identity-js: ^6.2.0 => 6.2.0
aws-amplify: ^5.2.5 => 5.2.5
expo: ^49.0.0-alpha.3 => 49.0.0-alpha.3
expo-constants: ~14.3.0 => 14.3.0
expo-image-picker: ~14.1.1 => 14.1.1
expo-linking: ~4.1.0 => 4.1.0
expo-router: ^1.7.1 => 1.7.1
expo-splash-screen: ~0.19.0 => 0.19.0 (0.18.2)
expo-status-bar: ~1.5.0 => 1.5.0
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.71.7 => 0.71.7
react-native-gesture-handler: ~2.9.0 => 2.9.0
react-native-reanimated: ~3.0.2 => 3.0.2
react-native-safe-area-context: 4.5.0 => 4.5.0
react-native-screens: ~3.20.0 => 3.20.0
react-native-svg: 13.4.0 => 13.4.0
react-native-svg-transformer: ^1.0.0 => 1.0.0
react-native-web: ~0.18.7 => 0.18.12
sass: ^1.62.1 => 1.62.1
typescript: ^5.0.4 => 5.1.3
npmGlobalPackages:
@aws-amplify/cli: 10.6.1
amplify-category-video: 3.9.2
aws-cdk: 2.76.0
corepack: 0.15.3
eas-cli: 3.7.2
npm: 9.3.0
yarn: 1.22.1
The text was updated successfully, but these errors were encountered: