Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web export with server output results in 404s for routes in tabs with shared array syntax #27456

Closed
erickreutz opened this issue Mar 5, 2024 · 0 comments · Fixed by #27462
Closed
Assignees
Labels
needs review Issue is ready to be reviewed by a maintainer Router expo-router

Comments

@erickreutz
Copy link

Minimal reproducible example

https://github.com/erickreutz/expo-router-server-bundle-404-reproduction

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

bun

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

metro

Summary

When using shared routes array syntax within a <Tabs /> layout the dist/ of expo export returns 404s for valid routes when using metro + server output.

Steps to reproduce:

bun install
bun start
# Navigating to http://localhost:8081/one directly in the address bar renders the correct page

bun expo export -p web
node server.js
# Navigating to http://localhost:3000/one directly in the address bar renders a 404

Environment

expo-env-info 1.0.5 environment info:
System:
OS: macOS 14.2.1
Shell: 5.9 - /opt/homebrew/bin/zsh
Binaries:
Node: 18.14.1 - ~/.asdf/installs/nodejs/18.14.1/bin/node
Yarn: 1.22.17 - ~/.asdf/shims/yarn
npm: 9.3.1 - ~/.asdf/plugins/nodejs/shims/npm
Watchman: 2024.01.22.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /Users/eric/.asdf/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10671973
Xcode: 15.2/15C500b - /usr/bin/xcodebuild
npmPackages:
expo: ~50.0.8 => 50.0.8
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.73.4 => 0.73.4
react-native-web: ~0.19.6 => 0.19.10
npmGlobalPackages:
eas-cli: 5.9.0
Expo Workflow: managed

@erickreutz erickreutz added needs validation Issue needs to be validated Router expo-router labels Mar 5, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Mar 5, 2024
@EvanBacon EvanBacon assigned EvanBacon and unassigned kitten Mar 5, 2024
EvanBacon added a commit that referenced this issue Mar 6, 2024
EvanBacon added a commit that referenced this issue Mar 7, 2024
…rts (#27462)

# Why

- fix #27456

<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->

# How

- add support for API routes to match array syntax variations.
- add support for exporting each unique nested variation of HTML routes
for server hosting.


<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

- Added extensive tests for the new logic in the server manifest
creation, html collection, and e2e server requesting.
- I've also updated the CLI collection tests to use the same manifest
mock creation as the integration navigation tests.

<!--
Please describe how you tested this change and how a reviewer could
reproduce your test, especially if this PR does not include automated
tests! If possible, please also provide terminal output and/or
screenshots demonstrating your test/reproduction.
-->

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer Router expo-router
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants