t3-oss / create-t3-turbo

Clean and simple starter repo using the T3 Stack along with Expo React Native
https://turbo.t3.gg
MIT License
4.27k stars 350 forks source link

The development server returned response error code: 404 URL: http://192.168.0.60:8081/node_moduleslexpo-router/entry.bundle #1060

Closed EnriqueHernandezHub closed 1 month ago

EnriqueHernandezHub commented 1 month ago

Provide environment information

  System:
    OS: macOS 14.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 288.77 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.0 - ~/.nvm/versions/node/v20.12.0/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.0/bin/npm
    pnpm: 9.1.3 - ~/.nvm/versions/node/v20.12.0/bin/pnpm

Describe the bug

Full error stack:

The development server returned response error code: 404
URL: http://192.168.0.60:8081/node_moduleslexpo-router/entry.bundle?platform=android&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=src%2 Fapp
Body:
('originModulePath":"/Users/ enriquehernandezanqalab/Documents/CodeHub/ pitchpal/apps/expo/"" targetModuleName":"/ node_modules/expo-router/ entry""message":"Unable to resolve module ./ node_modules/expo-router/entry from /Users/ enriquehernandezanqalab/Documents/ CodeHub/ pitchpal/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|.c js|.android. scss|.native.scss|.scss|. android.sass |.native.sass|.sass|.android. css]. native.css|.css) \n node_modules/expo-router/entry/ index(.android.ts|.native.ts|.ts|. android.tsx|.na tive.tsx\.tsx|.android.mjs|.native.mjsl.mjs|.and roid.js|.native.js).js|.android.jsx|.native.jsx|.jsx|. android.json|.native.json| .json|.android. cjs|.nat ive.cjs|.cjs|.android.scss|. native. scss|.scss|.an droid.sass|. native.sass|.sass|. android.css].n ative.css|.css)""cause":('candidates":("file": ('type":"sourceFile""filePath Prefix":"node_mo dules/expo-router/entry" candidateExts":
m".android.ts"". native.ts"". ts"".android.tsx""na
e.jsx""jsx". android.json";. native.json"" json"" .android.cjs"". native.cjs"".cjs"".android. scss"" .native.scss"".scs"". android. sass"". [native.sa](http://native.sa/) ss"".sass"".android.css"".native.css"".css"}'dir": ("type":"sourceFile""filePathPrefix":"'node_mod ules/expo-router/entry/index"'candidateExts": android.ts"". native.ts"". ts"".android.tsx".n ative.tsx"".tsx"".android.mjs"".native.mjs"".mj s"".android.js"" . native.js"" js";".android.jsx"".n ative.jsx" jsx"". android.json".native.json"" json "".android.cjs"".native.cjs"".cjs"".android.scss"".n ative.scss"".scss"".android.sass".native.sass"".s ass"".android.css"".native.css"".css"}'name":"Er ror""message":"The module could not be resolved because none of these files exist:\n\n * /Users/ enriquehernandezanqalab/Documents/CodeHub/ pitchpal/apps/expo/node_modules/expo-router/ entry(.android.ts|.native.ts|.ts|.android.tsx|.nat ive.tsx\.tsx|.android.mjs|.native.mjs].mjs|.android js|.native.js|.js|. android.jsx|.native.jsx|,jsx|.androi d.json|.native.jsonl.json|.android.cjs|.native.cjs|.c js|.android.scss|. native.scss|.scss|.android.sass|. native.sass|.sass|.android.css|. native.css|.css) \n * /Users/enriquehernandezanqalab/Documents/ CodeHub/pitchpal/apps/expo/node_modules/ expo-router/entry/index(. android.ts|.native. ts|.ts).android.tsx|.native.tsx|. tsx|.android.m js|.native.mjs|.mjs|.android.js|.native.jsl.js|.a ndroid.jsx|.native.jsx.jsx|.android.json nativ e.jsonl.json].android.cjs.native.cjs|.cjs|.android.s css|.native.scss|. scss|.android.sass|.native.sass| .sass|.android.css|.native.css|.css)""'stack":"Error: The module could not be resolved because none of these files exist:\n\n */Users/ enriquehernandezanqalab/Documents/CodeHub/ pitchpal/apps/expo/node_modules/expo-router/ entry(.android.ts|.native.ts|.ts).android. tsx|.rId.js|.native.js|.js|.android.jSX|.native.jsx\.JSX|.and roid.json|.native.json|.json|.android.cjs|.native.cjs |.cjs].android.scss|.native.scss|.scss|. android. sas sl.native.sass].sass|. android.css|. native.css|.css) In */Users/enriquehernandezanqalab/ Documents/CodeHub/pitchpal/apps/ expo/node_modules/expo-router/entry/ index(.android.ts|.native.ts|.ts|.android.tsx|.n ative.tsxl.tsx|.android.mjs|.native. mjs|.mjs|.andro id.js|.native.jsl js|.android.jsx\.native.jsx|.jsx.and roid.json|.native.json|.json).android.cjs|.native.cjs |.cjs|.android. scss|.native.scss|.scss|. android.sas s|.native.sass|. sas|.android.css|. native.css|. css) at upstreamResolve Request (/Users/ enriquehernandezangalab/Documents/CodeHub/ pitchpal/node_modules/metro-resolver/src/ resolve.js:44:13)\n at resolveRequest (Users/enriquehernandezanqalab/Documents /CodeHub/pitchpal/node_modules/@expo/cli /src/start/server/metro/with MetroResolvers.ts: 94:20)\n
enriquehernandezanqalab/Documents/CodeHub/ pitchpal/node_modules/metro-resolver/src/ resolve.js:32:12)\n at firstResolver (/Users lenriquehernandezanqalab/Documents /CodeHub/pitchpal/node_modules/@expo/cli /src/start/server/metro/with MetroResolvers .ts:94:20)\n
/enriquehernandezanqalab/Documents /CodeHub/pitchpal/node_modules/@expo/cli Isrc/start/server/metro/withMetroResolvers .ts:108:16)\n
lenriquehernandezanqalab/Documents /CodeHub/pitchpal/node_modules/@expo/cli Isrc/start/server/metro/with MetroResolvers .ts:137:16)\n at Object.resolve (/Users/ enriquehernandezanqalab/Documents/CodeHub/pitchpal/node_modules/ metro-resolver/src/resolve.js:32:12)\n at ModuleResolver. resolveDependency (/Users/ enriquehernandezanqalab/Documents/CodeHub/ pitchpal/node_modules/metro/src/node-haste/ DependencyGraph/ModuleResolution.js:73:31)\n at DependencyGraph.resolveDependency ((Users/enriquehernandezanqalab/Documents/ CodeHub/pitchpal/node_modules/metro/src/ node-haste/DependencyGraph.js:231 :43)\n at Users/enriquehernandezanqalab/Documents/ CodeHub/pitchpal/node_modules/metro/src/ lib/transformHelpers.js:1 56:21"}'errors": K"description":"Unable to resolve module ./ node_modules/expo-router/entry from /Users/ enriquehernandezanqalab/Documents/ CodeHub/pitchpal/apps/expo/.: \n\nNone of these files exist:\n *node_modules/expo-router/ entry(.android.ts|.native.ts|.ts|.android.tsx].n ative.tsx|.tsx|.android.mjs|.native.mjsl.mjs|.andro id.js|.native.jsl. js|.android.jsx|.native.jsx|.Jjsx|.and roid.json|.native.json|.json|.android.cjs|.native.cjs |.cjs|.android.scss|. native.scss|.scss|. android.sas s|.native.sass| .sasss|.android.css| .native.css|. css) node_modules/expo-router/entry/ index(.android.ts).native.ts).ts|.android.tsx|.n ative.tsx|.tsx|.android.mjs|.native.mjs|.mjsl.andro id.js|.native.jslJjs).android.jsx|.native.jsx|Jjsx|.and roid.json|.native.json|.json|.android.cjs|.native.cjs |.cjs|.android.scss|. native.scss|.scss|.android.sas s|.native.sass|.sass|. android. css|. native.css|.css Y'name":"Error""'stack":"Error: Unable to resolve module ./node_modules/expo-router/entry from / Users/enriquehernandezanqalab/Documents/ CodeHub/pitchpal/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].andro id.js|.native.js|,js|.android.jsx|.native.jsx|.jsx|. and roid.json|.native.json|.json|.android.cjs|.native.cjs |.cjs|.android.scss|. native. scss|.scss|.android. sas s|.native.sass|. sass|.android.css|.native.css|.css) node_modules/expo-router/entry/ index(.android.ts|.native.ts|.ts|.android.tsx|.n ative.tsx|.tsx|. android.mjs|.native. mjs|.mjs|.andro id.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.and roid.json|.native.jsonl.json|.android.cjs|.native.cjs |.cjs|.android. scss|.native.scss|.scss|.android. sas s|.native.sass|. sass|.android. css|.native.css]. css) at ModuleResolver.resolveDependency (/Users/enriquehernandezangalab/Documents/ CodeHub/pitchpal/node_modules/metro/ src/node-haste/DependencyGraph/ ModuleResolution.js:112:15)\n at DependencyGraph.resolveDependency (/
Users/enriquehernandezanqalab/Documents/ CodeHub/pitchpal/node_modules/metro/ src/node-haste/DependencyGraph.js:231:43) \n at /Users/enriquehernandezanqalab/Documents/ CodeHub/pitchpal/node_modules/metro/ src/lib/transformHelpers.js:1 56:21\n Server._resolve RelativePath (/Users/ enriquehernandezanqalab/Documents/ CodeHub/pitchpal/node_modules/ metro/src/Server.js:1023:12)\n at Server.requestProcessor las -processBundleRequest| ((Users/ enriquehernandezanqalab/Documents/CodeHub/ pitchpal/node_modules/metro/src/
Server.js:423:33)\n
(/Users/enriquehernandezanqalab/Documents/ CodeHub/pitchpal/node_modules/metro/ src/Server.js:360:7)}

Link to reproduction

https://www.dropbox.com/scl/fi/zlom4ind0f2qa0de3mqg3/Screenshot-2024-06-03-at-15.23.15.png?rlkey=184sgas68gd7t1su4o92rupse&dl=0

To reproduce

$ pnpm run dev

Then, selecting s (switch to development build) and a (open Android).

It is reproducible both in an emulator and an actual Android device connected by USB.

Additional information

We tried clearing the cache for pnpm and node, as well as:

rm -rf node_modules
pnpm install
pnpm store prune
pnpm cache clean
pnpm install
pnpm remove -g pnpm
npm install -g pnpm
pnpm remove expo-router
pnpm add expo-router
expo start -c
dBianchii commented 1 month ago

Related to https://github.com/t3-oss/create-t3-turbo/issues/741. I had the same problem and I fixed it by following the guide on that closed issue.

@juliusmarminge Can I provide a PR for this fix with the index.js hack?

EnriqueHernandezHub commented 1 month ago

Thank you very much for the help, @dBianchii

It is indeed the same issue, and I was able to solve it by using the comment from #741. I mark this issue as closed now.