expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
41.79k stars 7.61k forks source link

TypeError: 0, _expoRouter.useSegments is not a function (it is undefined) #37563

Closed kuriel-dev closed 3 weeks ago

kuriel-dev commented 3 weeks ago

Issue description

Why expo-router is not being included in build proccess?

it's readed from plugins build

Image

BUT, not really included in build proccess

Image

producing at runtime:

TypeError: 0, _expoRouter.useSegments is not a function (it is undefined)

Environment

expo-env-info 1.3.3 environment info:
    System:
      OS: Linux 6.6 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
      Shell: 5.2.21 - /bin/bash
    Binaries:
      Node: 22.16.0 - ~/.nvm/versions/node/v22.16.0/bin/node
      Yarn: 1.22.22 - /mnt/c/Program Files/nodejs/yarn
      npm: 11.4.1 - ~/.nvm/versions/node/v22.16.0/bin/npm
    SDKs:
      Android SDK:
        API Levels: 34, 35
        Build Tools: 34.0.0, 35.0.0
        Android NDK: 25.2.9519653
    npmPackages:
      expo: ^53.0.12 => 53.0.12
      expo-router: ~5.1.0 => 5.1.0
      expo-updates: ~0.28.15 => 0.28.15
      react: 19.0.0 => 19.0.0
      react-dom: 19.0.0 => 19.0.0
      react-native: 0.79.4 => 0.79.4
      react-native-web: ^0.20.0 => 0.20.0
    npmGlobalPackages:
      eas-cli: 16.11.0
    Expo Workflow: managed

Expo Doctor Diagnostics

14/15 checks passed. 1 checks failed. Possible issues detected:
Use the --verbose flag to see more details about passed checks.

✖ Validate packages against React Native Directory package metadata
The following issues were found when validating your dependencies against React Native Directory:
  Untested on New Architecture: react-native-iap
  Unmaintained: react-native-event-source, react-native-hyperlink
kuriel-dev commented 3 weeks ago

Problem fixed by changing this:

    "baseUrl": ".",
    "jsx": "react-jsx",

By this:

- "baseUrl": ".", // <-- REMOVE
"jsx": "react",