remix icon indicating copy to clipboard operation
remix copied to clipboard

Routing file version 2 nested layout path does not match

Open omakise opened this issue 2 years ago • 2 comments

What version of Remix are you using?

1.11.1

Steps to Reproduce

Test repository: https://github.com/akun2333/remix-netlify Deploy demo: https://superlative-chimera-88b2c1.netlify.app/

Expected Behavior

Normal route matching

Actual Behavior

The access path post/about is fine in development mode, but not when deployed to netlify

omakise avatar Jan 21 '23 17:01 omakise

not getting post/about in dev, but when using flat routes and folders, the route file must be index

app/
├── routes/
│   └── _post.post/about
│       └── index.md

mcansh avatar Jan 22 '23 20:01 mcansh

@akun2333 Remember that once you start adding folders, flat routes will switch to flat-folders mode (it assumes you want colocation). The folder name itself is the route. The route file must be index.js or (.tsx, .md, etc.).

It's the same as the index file when doing imports from a folder. import About from '~/routes/_post.post/about'

Any other file, like component.tsx, styles.css, logo.png, etc. will be treated as a colocated file.

flat-file routes/_post.post.about.md

flat-folder routes/_post.post.about/index.md

kiliman avatar Jan 23 '23 14:01 kiliman