expo-cli icon indicating copy to clipboard operation
expo-cli copied to clipboard

[next-js] Error: Unable to resolve module ./index from <PROJECT_ROOT>

Open oVerde opened this issue 2 years ago • 0 comments

Summary

The project can't even start, as the build phase starts it crash asking for a missing module that its name is unknown.

Environment

 expo-env-info 1.0.5 environment info:
    System:
      OS: Linux 5.19 Pop!_OS 22.04 LTS
      Shell: 5.9 - /home/linuxbrew/.linuxbrew/bin/zsh
    Binaries:
      Node: 16.16.0 - ~/.volta/tools/image/node/16.16.0/bin/node
      Yarn: 3.2.2 - ~/.volta/tools/image/yarn/1.22.18/bin/yarn
      npm: 8.12.1 - ~/.volta/tools/image/npm/8.12.1/bin/npm
      Watchman: 2022.07.04.00 - /home/linuxbrew/.linuxbrew/bin/watchman
    SDKs:
      Android SDK:
        API Levels: 26, 30, 31, 32, 33
        Build Tools: 26.0.0, 29.0.2, 30.0.2, 30.0.3, 33.0.0, 33.0.0
        System Images: android-30 | Google Play Intel x86 Atom_64
    npmPackages:
      expo: ~46.0.3 => 46.0.3 
      react: 18.0.0 => 18.0.0 
      react-native: 0.69.4 => 0.69.4 
    npmGlobalPackages:
      expo-cli: 5.5.1
    Expo Workflow: managed

Please specify your device/emulator/simulator platform, model and version

ExpoGO

Error output

Logs for your project will appear below. Press Ctrl+C to exit.
Started Metro Bundler
Error: Unable to resolve module ./index from /home/daniloverde/conduit/Conduit/.: 

None of these files exist:
  * 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)
  * index/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 ModuleResolver.resolveDependency (/home/daniloverde/conduit/Conduit/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:136:15)
    at DependencyGraph.resolveDependency (/home/daniloverde/conduit/Conduit/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
    at /home/daniloverde/conduit/Conduit/node_modules/metro/src/lib/transformHelpers.js:129:24
    at Server._resolveRelativePath (/home/daniloverde/conduit/Conduit/node_modules/metro/src/Server.js:1137:12)
    at Server.requestProcessor [as _processBundleRequest] (/home/daniloverde/conduit/Conduit/node_modules/metro/src/Server.js:464:37)
    at Server._processRequest (/home/daniloverde/conduit/Conduit/node_modules/metro/src/Server.js:420:9)
Error: Unable to resolve module ./index from /home/daniloverde/conduit/Conduit/.: 

None of these files exist:
  * 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)
  * index/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 ModuleResolver.resolveDependency (/home/daniloverde/conduit/Conduit/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:136:15)
    at DependencyGraph.resolveDependency (/home/daniloverde/conduit/Conduit/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
    at /home/daniloverde/conduit/Conduit/node_modules/metro/src/lib/transformHelpers.js:129:24
    at Server._resolveRelativePath (/home/daniloverde/conduit/Conduit/node_modules/metro/src/Server.js:1137:12)
    at Server.requestProcessor [as _processBundleRequest] (/home/daniloverde/conduit/Conduit/node_modules/metro/src/Server.js:464:37)
    at Server._processRequest (/home/daniloverde/conduit/Conduit/node_modules/metro/src/Server.js:420:9)
› Stopped server

Reproducible demo or steps to reproduce from a blank project

  • Bootstrap your project with Expo
    • Install the CLI: npm i -g expo-cli
    • Create a project: expo init --template blank
    • cd into the project
  • Install the adapter:
    • yarn: yarn add @expo/next-adapter
    • npm: npm i --save @expo/next-adapter
  • Add Next.js support: yarn next-expo
    • Always commit your changes first!
    • You can optionally choose which customizations you want to do with --customize or -c
    • Force reload changes with --force or -f
  • Start the project with yarn next dev
    • Go to http://localhost:3000/ to see your project!

The Next wont' start neither expo start

oVerde avatar Aug 11 '22 22:08 oVerde