Skip to content
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

Metro error: Unable to resolve module u/unimodules/core from expo-splash-screen/build/SplashScreen.js #28340

Open
drewboardman opened this issue Apr 20, 2024 · 1 comment
Labels
needs review Issue is ready to be reviewed by a maintainer SplashScreen

Comments

@drewboardman
Copy link

Minimal reproducible example

https://github.com/drewboardman/expo-router-amplify-issue/tree/main

What platform(s) does this occur on?

Web

Did you reproduce this issue in a development build?

Yes

Summary

As the title explains, I see an error when building and running this minimal expo example:

Metro error: Unable to resolve module u/unimodules/core from /Users/drew/code/navigation-router-example/node_modules/expo-splash-screen/build/SplashScreen.js: u/unimodules/core could not be found within the project or in these directories: node_modules/expo-splash-screen/node_modules node_modules
1 | import { UnavailabilityError } from '@unimodules/core'; |                                      ^ 2 | import ExpoSplashScreen from './ExpoSplashScreen'; 3 | /** 4 |  * Makes the native splash screen stay visible until SplashScreen.hideAsync() is called.
Call Stack requireFileContentsWithMetro (node_modules/@expo/cli/src/start/server/getStaticRenderFunctions.ts:191:13) processTicksAndRejections (node:internal/process/task_queues) Object.getStaticRenderFunctions (node_modules/@expo/cli/src/start/server/getStaticRenderFunctions.ts:213:45) bundleStaticHtml (node_modules/@expo/cli/src/start/server/metro/MetroBundlerDevServer.ts:334:36) MetroBundlerDevServer.getStaticPageAsync (node_modules/@expo/cli/src/start/server/metro/MetroBundlerDevServer.ts:351:52) Unable to resolve "@unimodules/core" from "node_modules/expo-splash-screen/build/SplashScreen.js" λ Bundling failed 6882ms (node_modules/expo-router/node/render.js) Unable to resolve "@unimodules/core" from "node_modules/expo-splash-screen/build/SplashScreen.js" Web Bundling failed 1601ms (node_modules/expo-router/entry.js) Unable to resolve "@unimodules/core" from "node_modules/expo-splash-screen/build/SplashScreen.js" Web Bundling failed 6886ms (node_modules/expo-router/entry.js) Unable to resolve "@unimodules/core" from "node_modules/expo-splash-screen/build/SplashScreen.js"

Environment

This is running on my laptop. I got another friend to reproduce the error on his machine with the same repo.

Expo Doctor Diagnostics

$ npx expo-doctor@latest
Need to install the following packages:
expo-doctor@1.5.0
Ok to proceed? (y) y
(node:2080) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for issues with metro config
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✖ Check that packages match versions required by installed Expo SDK
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK

Detailed check results:

(node:2150) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
The following packages should be updated for best compatibility with the installed expo version:
@react-native-async-storage/async-storage@1.23.1 - expected version: 1.21.0
@react-native-community/netinfo@11.3.1 - expected version: 11.1.0
react-native-get-random-values@1.11.0 - expected version: ~1.8.0
react-native-safe-area-context@4.9.0 - expected version: 4.8.2
Your project may not work correctly until you install the correct versions of the packages.
Found outdated dependencies
Advice: Use 'npx expo install --check' to review and upgrade your dependencies.

One or more checks failed, indicating possible issues with the project.

@drewboardman drewboardman added the needs validation Issue needs to be validated label Apr 20, 2024
@drewboardman drewboardman changed the title Metro error: Unable to resolve module u/unimodules/core fromexpo-splash-screen/build/SplashScreen.js Metro error: Unable to resolve module u/unimodules/core from expo-splash-screen/build/SplashScreen.js Apr 20, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Apr 20, 2024
@byCedric
Copy link
Member

Hi @drewboardman! What version of expo-splash-screen do you have installed locally? E.g. run node --print "require('expo-splash-screen/package.json').version" in the project root.

It seems that you are using a very old version of expo-splash-screen, that still tries to load the close-to-3-years-deprecated unimodules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer SplashScreen
Projects
None yet
Development

No branches or pull requests

3 participants