expo: BaseUrl reload redirects incorrect

Minimal reproducible example

https://github.com/rocket-meals/expo-baseUrl-reload-error

Which package manager are you using? (Yarn is recommended)

npm

If the issue is web-related, please select the bundler (web.bundler in the app.json)

metro

Summary

As described i am setting up the experimental baseUrl in app.json. In my example its named rocket-meals. So as i start up the app and open the browser using npm run deploy:local which calls expo export -p web.

when i then route to http://localhost:3000/rocket-meals/ in my case it redirects me to the login page since it is called in (app)/_layout.js to return <Redirect href="/(auth)/login" />

The problem:

this works just fine as the url in the browser changes to http://localhost:3000/rocket-meals/login nice. But when i enter the url and hit enter to visit http://localhost:3000/rocket-meals/login it now redirects me to: http://localhost:3000/login but displays the correct conent. The problem is that this redirect seems wrong as it does not use the baseUrl Now it comes the the critical place as i enter the url again it well tells me that this page do not exist. Using the expo start --webbrings the problem that the baseUrl it ommited completly.

The second related problem

The next problem is: let url = createURL("/login"); creates me a link without the baseUrl at all.

The third related problem

Using: <ExternalLink href={url} style={styles.link}> somehow creates a link with the url of the app before but only in production mode and not in dev mode.

At first visit of the page: Bildschirmfoto 2024-01-21 um 19 28 08

When i hit enter at the url: http://localhost:3000/rocket-meals/login it redirects me wrong: Bildschirmfoto 2024-01-21 um 19 28 50

Environment

System:
  OS: macOS 13.4.1
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node
  Yarn: 1.22.21 - /usr/local/bin/yarn
  npm: 8.19.4 - ~/.nvm/versions/node/v16.20.2/bin/npm
  Watchman: 2023.11.27.00 - /usr/local/bin/watchman
Managers:
  CocoaPods: 1.14.3 - /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11076708
  Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
npmGlobalPackages:
  eas-cli: 6.0.0
Expo Workflow: managed

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

Hi @marklawlor I saw that you already worked on PR for this issue, Do you know when it will be available?