t3-oss / create-t3-turbo

Clean and simple starter repo using the T3 Stack along with Expo React Native

Home Page:https://turbo.t3.gg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: Java.Lang.Exception: Failed to load all assets

rubensdeoliveira opened this issue · comments

Provide environment information

System:
OS: Linux 6.5 Zorin OS 17 17
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 20.44 GB / 31.18 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
Yarn: 1.22.21 - ~/.nvm/versions/node/v20.11.0/bin/yarn
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
pnpm: 8.15.2 - ~/.nvm/versions/node/v20.11.0/bin/pnpm

Describe the bug

Hello everyone, everything good?

I've been trying to run the expo project on android emulator for two days and I haven't managed to do it yet. I tried several approaches, including creating a new expo project from scratch with no dependencies, but nothing worked. I'm getting a java.lang.Exception. Does anyone know how to solve it? Apparently he is getting lost in asset imports, but there is only one asset being imported and it is in the folder.

Link to reproduction

https://github.com/t3-oss/create-t3-turbo

To reproduce

Just import the project, run pnpm i, copy .env and try to run expo project on android emulator in linux.

Additional information

No response

Hi, I'm running an exact clone of the project on both android + ios, on Windows + Mac. Can you provide us a little bit more information on the version of android you are using, the sdk and the version of expo-go on the emulator? I can spawn a vm for linux to check later today.

@VaniaPopovic I'm hitting the same issue. I'm using the following versions:

Android version: 14.0 (U) - API 34
Android SDK Platform-Tools version: 35.0.0
Emulator version: 33.1.24-11237101

Same error running

pnpm 8.5.1, emulator version 32.1.15.0, Android SDK platform-tools version: 34.0.4, Android version: 9

this is the command for future commenters to get all the versions above quickly:

$ echo "pnpm $(pnpm -v), emulator version $(emulator --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'), Android SDK platform-tools version: $(grep 'Pkg.Revision=' $ANDROID_HOME/platform-tools/source.properties | cut -d'=' -f2), Android version: $(adb shell getprop ro.build.version.release)"

Little debugging goes by, I find this in adb logcat

02-25 00:08:38.756 28276 31619 E Loader  : java.lang.Exception: Network request failed: {"originModulePath":"/mnt/projects/coding/js/fuckturbo/apps/expo/.","targetModuleName":"./node_modules/expo-router/entry"," message":"Unable to resolve module ./node_modules/expo-router/entry from /mnt/projects/coding/js/fuckturbo/apps/expo/.: \n\nNone of these files exist:\n  * node_modules/expo-router/entry(.android.ts|.native.ts|. ts|.android.tsx|.native.tsx|.tsx|.android.mjs|.native.mjs|.mjs|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs|.android.scss|.native.scss|. scss|.android.sass|.native.sass|.sass|.android.css|.native.css|.css|.android.css|.native.css|.css)\n  * node_modules/expo-router/entry/index(.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.mjs| .native.mjs|.mjs|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs|.android.scss|.native.scss|.scss|.android.sass|.native.sass|.sass|.android .css|.native.css|.css|.android.css|.native.css|.css)","cause":{"candidates":{"file":{"type":"sourceFile","filePathPrefix":"node_modules/expo-router/entry","candidateExts":["",".android.ts",".native.ts",".ts",".a ndroid.tsx",".native.tsx",".tsx",".android.mjs",".native.mjs",".mjs",".android.js",".native.js",".js",".android.jsx",".native.jsx",".jsx",".android.json",".native.json",".json",".android.cjs",".native.cjs",".cjs ",".android.scss",".native.scss",".scss",".android.sass",".native.sass",".sass",".android.css",".native.css",".css",".android.css",".native.css",".css"]},"dir":{"type":"sourceFile","filePathPrefix":"node_modules /expo-router/entry/index","candidateExts":["",".android.ts",".native.ts",".ts",".android.tsx",".native.tsx",".tsx",".android.mjs",".native.mjs",".mjs",".android.js",".native.js",".js",".android.jsx",".native.jsx ",".jsx",".android.json",".native.json",".json",".android.cjs",".native.cjs",".cjs",".android.scss",".native.scss",".scss",".android.sass",".native.sass",".sass",".android.css",".native.css",".css",".android.css ",".native.css",".css"]}},"name":"Error","message":"The module could not be resolved because none of these files exist:\n\n  * /mnt/projects/coding/js/fuckturbo/apps/expo/node_modules/expo-router/entry(.android. ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.mjs|.native.mjs|.mjs|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs|.android.scss |.native.scss|.scss|.android.sass|.native.sass|.sass|.android.css|.native.css|.css|.android.css|.native.css|.css)\n  * /mnt/projects/coding/js/fuckturbo/apps/expo/node_modules/expo-router/entry/index(.android.ts |.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.mjs|.native.mjs|.mjs|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs|.android.scss|. native.scss|.scss|.android.sass|.native.sass|.sass|.android.css|.native.css|.css|.android.css|.native.css|.css)","stack":"Error: The module could not be resolved because none of these files exist:\n\n  * /mnt/pr ojects/coding/js/fuckturbo/apps/expo/node_modules/expo-router/entry(.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.mjs|.native.mjs|.mjs|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx |.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs|.android.scss|.native.scss|.scss|.android.sass|.native.sass|.sass|.android.css|.native.css|.css|.android.css|.native.css|.css)\n  * /mnt/projects/c oding/js/fuckturbo/apps/expo/node_modules/expo-router/entry/index(.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.mjs|.native.mjs|.mjs|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|. android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs|.android.scss|.native.scss|.scss|.android.sass|.native.sass|.sass|.android.css|.native.css|.css|.android.css|.native.css|.css)\n    at upstreamResolv eRequest (/mnt/projects/coding/js/fuckturbo/node_modules/metro

Which is basically stating that expo-router (apparently the first module to look for) does not exist in app/expo/node_modules
I go check app/expo/node_modules
nothing there, just a .cache folder
tried it with pnpm, npm, bun, LOST A TON OF DATA ON METERED CONNECTION, still at loss
any idea why could that be the issue? and what's the norm when it runs? I tried versions back to 1.11.0 and the same issue occurs
WHY
node -v = 21.6.1, npm -v = 10.4.0

imma try with a different version tomorrow, until then y'all have a good night/day

EDIT:
node -v = 18.17.0, npm -v =9.6.7
still no luck

WITH DOPAMINE RUSHING THROUGH MY BRAIN I CAN HAPPILY TELL YOU
to solve the issue, we can create a symbolic link that links ./node_modules to apps/expo/node_modules

From project's root, run:

ln -s ./node_modules apps/expo/node_modules

and then it works 🥳🥳🥳
THANKS FOR THE AMAZING PROJECT, this will get me some sweet honey dolla dolla baby let's gooooooooooooooooooo

LETS FUCKING GO ball meme

This one works for me. See #741 (comment).

Works as expected. Thank you. For those who are still not sure how to do it:

  1. change the 'main' property inside of expo app package.json from
    from: "main": "expo-router/entry",
    to: "main": "index.js",
  2. add needed index.js file next to the package.json file. In my case I created apps/expo/index.js file .
  3. inside of the index.js file I added just 1 line:
import 'expo-router/entry'
  1. save all files and restart the expo:android server

This should work as it did in my case.