solidjs / solid-router

A universal router for Solid inspired by Ember and React Router
MIT License
1.13k stars 143 forks source link

The new version of ruoting is not working #313

Closed TheElegantCoding closed 9 months ago

TheElegantCoding commented 9 months ago

Describe the bug

i am not using default import for my components maybe that is the error but i have this and nothing show, no error in console

import { HomePage } from '@module/home/page/home_page';
import { MarketingAdsPage } from '@module/home/page/marketing_ads_page';
import { homeRouterPath } from '@module/home/router/home_router_path';
import { Route, Router } from '@solidjs/router';

import type { JSX } from 'solid-js';

const App = (): JSX.Element => (
  <Router>
    <Route
      component={HomePage}
      path={homeRouterPath.home}
    />
    <Route
      component={MarketingAdsPage}
      path={homeRouterPath.marketingAds}
    />
  </Router>
);

export { App };

My home page

const HomePage = (): JSX.Element => (
  <>
    <header>
      <Navbar />
      <Principal />
    </header>
    <PrincipalSlider />
    <main>
      <AboutUs />
      <SectionService />
      <SectionContact />
      <SectionGoodbye />
    </main>
    <footer>
      <Footer />
      <FooterCopyright />
    </footer>
  </>
);

export { HomePage };

My marketing ads page

import type { JSX } from 'solid-js';

const MarketingAdsPage = (): JSX.Element => (
  <div />
);

export { MarketingAdsPage };

i dont think this is stable i will dump to 0.9.0 version i need to finish this website today

Your Example Website or App

i will added if needed

Steps to Reproduce the Bug or Issue

create the elements

Expected behavior

show the page and the components, or and error, no error and nothing is in the screen

Screenshots or Videos

No response

Platform

Additional context

No response

ryansolid commented 9 months ago

Can I get a reproduction? I've converted about a dozen examples so far and haven't hit any issues like this. The core routing logic hasn't changed with his release. If there is an issue I imagine it is in the top level wiring that I can't see in completion from the example code. I have several examples that are more or less simple like this that work no problem.

Brendan-csel commented 9 months ago

Just noting, I've also just completed updating one of our apps to router version 0.10.1 and it is working fine. This app has 300 routes and also includes a nested <HashRouter>. Client-side rendering only though.

Aside: migrating was trivial. The only bit that felt awkward was moving everything surrounding our Routes to be inside the router's root property.

TheElegantCoding commented 9 months ago

sorry I made the reproduction and I found maybe it was an error in how i structured the router i can't say what the mistake was, but 0.10.1 works well