chen-rn / CUA

(deprecateed) create-universal-app(CUA) is an opinionated template for creating fullstack universal apps (Expo, Next, tRPC, Prisma, Clerk, Solito, Tamagui)
https://cua-demo.vercel.app
MIT License
1.02k stars 67 forks source link

Running react native on ios failing #11

Closed BjoernRave closed 1 year ago

BjoernRave commented 1 year ago

When trying to run yarn native and then pressing i for iOS, I get the following error:

iOS Bundling failed 14290ms
error: Error: While resolving module `next/router`, the Haste package `next` was found. However the module `router` could not be found within the package. Indeed, none of these files exist:

  * `/Users/bjoern/projects/farmer-assistant-2/apps/next/router(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)`
  * `/Users/bjoern/projects/farmer-assistant-2/apps/next/router/index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)`
    at resolveHasteName (/Users/bjoern/projects/farmer-assistant-2/node_modules/metro-resolver/src/resolve.js:198:9)
    at Object.resolve (/Users/bjoern/projects/farmer-assistant-2/node_modules/metro-resolver/src/resolve.js:68:20)
    at ModuleResolver.resolveDependency (/Users/bjoern/projects/farmer-assistant-2/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:126:31)
    at DependencyGraph.resolveDependency (/Users/bjoern/projects/farmer-assistant-2/node_modules/metro/src/node-haste/DependencyGraph.js:264:43)
    at Object.resolve (/Users/bjoern/projects/farmer-assistant-2/node_modules/metro/src/lib/transformHelpers.js:170:21)
    at resolveDependencies (/Users/bjoern/projects/farmer-assistant-2/node_modules/metro/src/DeltaBundler/graphOperations.js:466:33)
    at processModule (/Users/bjoern/projects/farmer-assistant-2/node_modules/metro/src/DeltaBundler/graphOperations.js:232:31)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async addDependency (/Users/bjoern/projects/farmer-assistant-2/node_modules/metro/src/DeltaBundler/graphOperations.js:361:18)
    at async Promise.all (index 2)
Al-Ip commented 1 year ago

Same for android using expo go

Android Bundling failed 11503ms
error: Error: While resolving module `next/router`, the Haste package `next` was found. However the module `router` could not be found within the package. Indeed, none of these files exist:

* `X:\Projects\Javascript\sigmalife\apps\next\router(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)`
* `X:\Projects\Javascript\sigmalife\apps\next\router\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)`
at resolveHasteName (X:\Projects\Javascript\sigmalife\node_modules\metro-resolver\src\resolve.js:198:9)
at Object.resolve (X:\Projects\Javascript\sigmalife\node_modules\metro-resolver\src\resolve.js:68:20)
at ModuleResolver.resolveDependency (X:\Projects\Javascript\sigmalife\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:126:31)
at DependencyGraph.resolveDependency (X:\Projects\Javascript\sigmalife\node_modules\metro\src\node-haste\DependencyGraph.js:264:43)
at Object.resolve (X:\Projects\Javascript\sigmalife\node_modules\metro\src\lib\transformHelpers.js:170:21)
at resolveDependencies (X:\Projects\Javascript\sigmalife\node_modules\metro\src\DeltaBundler\graphOperations.js:466:33)
at processModule (X:\Projects\Javascript\sigmalife\node_modules\metro\src\DeltaBundler\graphOperations.js:232:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async addDependency (X:\Projects\Javascript\sigmalife\node_modules\metro\src\DeltaBundler\graphOperations.js:361:18)
at async Promise.all (index 2)
chen-rn commented 1 year ago

oh, might be a new bug introduced, looking into this

chen-rn commented 1 year ago

Fixed in the newest commit!

A couple days ago I changed our next app name from next-app to next so that the folder name and the package name is consistent. For the sake of deploying to Vercel.

Which created a conflict of namespace between "next" the node_modules framework and "next" our web app.

Should've saw that coming! Let me know if it works for you guys now.

BjoernRave commented 1 year ago

just tried it and it works :) Thanks for the quick fix