PacktPublishing / Full-Stack-Web-Development-with-Remix

Full Stack Web Development with Remix, published by Packt
MIT License
127 stars 24 forks source link

create-remix@2.3.0 adds `routes/_index.tsx` to templates even if they already have a `routes/_layout._index.tsx` file #127

Closed andrelandgraf closed 10 months ago

andrelandgraf commented 10 months ago

Describe the bug

When using create-remix@latest to check out a later version of BeeRich that comes with a routes/_layout._index.tsx file, then create-remix adds a default _index.tsx file to the project code.

This leads to a build error:

⚠️ Route Path Collision: "/"

The following routes all define the same URL, only the first one will be used

🟢 routes/_layout._index.tsx
⭕️️ routes/_index.tsx

Fix/Workaround

There is an easy fix! Just delete the _index.tsx file from the project before diving into the code! :)

To Reproduce

Steps to reproduce the behavior:

  1. Run npx create-remix@latest --template https://github.com/PacktPublishing/Full-Stack-Web-Development-with-Remix/tree/main/15-advanced-session-management/bee-rich/solution with a later version of BeeRich
  2. Follow the prompts in the terminal
  3. Open the BeeRich project in a file explorer and notice the added routes/_index.tsx file

Expected behavior

No _index.tsx file is added.

Actual behavior

Remix's default _index.tsx file is added to the BeeRich project code.

andrelandgraf commented 10 months ago

Seems to have been a one-off bug for me! Remix team closed the ticket as not reproducible. Glad this isn't an issue!