Giter Club home page Giter Club logo

Comments (2)

marklawlor avatar marklawlor commented on May 27, 2024 1

In your app.json your web.output is set to static. This means your website is rendered and served as static .html files. If the file doesn't exist, then you will get a 404.

To use dynamic routes with static rendering, you need to tell the bundler what the possible values of [bar] could be. This way it will generate the necessary .html files. https://docs.expo.dev/router/reference/static-rendering/#dynamic-routes

The alternative to static rendering is running your app as a Single Page Application. You can enable this by simply removing output: 'static' from your app.json. Now only a index.html file will be generated. You'll need to run your application via npx serve -s dist (-s enables single page mode) and ensure you setup the correct redirect rules in your deployment.

from expo.

Ethan925 avatar Ethan925 commented on May 27, 2024 1

Thank you! The second option (removing output: 'static' and changing to npx serve dist -s) did the trick for our use case.

(Pre-defining the dynamic routes wouldn't work for us because the dynamic route will be for [user].tsx pages, and new users can be created after the build)

from expo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.