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

Riot coupled with Riot-route crashes on the latest version #3005

Closed
1 of 7 tasks
steevepay opened this issue Apr 25, 2024 · 3 comments
Closed
1 of 7 tasks

Riot coupled with Riot-route crashes on the latest version #3005

steevepay opened this issue Apr 25, 2024 · 3 comments

Comments

@steevepay
Copy link

steevepay commented Apr 25, 2024

I tried to migrate to the latest version:

  • Riot 7.1.0 to Riot 9.1.5
  • @riotjs/route 8.0.2 to @riotjs/route 9.1.5
    However the routing crashes, and pages are replicated.

The Riot app tries to check if the route exists, if yes, it prints the component, otherwise it display a 404 component.

To reproduce the issue, I created a repository with the minimum of code, the error is on the branch riot_route_error (not on main):
https://github.com/steevepay/riot9-issue/tree/riot_route_error

Clone the repo and install NPM packages:

npm install

Then start vite:

npm run dev

Then visit the URL, then you will see the following error:
Screenshot 2024-04-25 at 13 43 38

The error is thrown from the index.riot file, at the following line:

this.update({ showNotFound: !this.state.pages.some(p => match(path.pathname, toRegexp(p?.path))) })  

I originally found this expression on your Riot-SSR example, then I used it for two years in production with Riot 7.1.0. That's why now I'm trying to migrate :D

  1. How would you tag this issue?
  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@steevepay steevepay changed the title Riot with Riot-route crashes on 404 Riot coupled with Riot-route crashes on the latest version Apr 25, 2024
@Kal-Aster
Copy link

Could be related to #3003 ?

@steevepay
Copy link
Author

Yes it seems to be the same issue

@GianlucaGuarini
Copy link
Member

Closing this issue since it's a duplicate of #3003

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants