seL3cT
seL3cT
SSolidJS
Created by seL3cT on 2/5/2025 in #support
solid router, absolute routes?
So i have compiled my solid app and have a few things i would like to change but dont know how, right now i host the app on my school server so for example server.com/name.surname/project_name/index.html so as u can see the app should run inside the project name folder but when i use the routing in the app, the search bar domain says for example server.com/contact and not server.com/name.surname/project_name/contact like it should which also makes the links not work when manually browsing to them, any fix? <Router root={Bars}> <Route path="/" component={Home} /> <Route path="/productie" component={Productie} /> <Route path="/over_ons" component={Over} /> <Route path="/historiek" component={Historiek} /> <Route path="/contact" component={Contact} /> <Route path="*" component={Verkeerde}/> </Router> that is my code for the routing
4 replies
SSolidJS
Created by seL3cT on 2/4/2025 in #support
Solid routing
so i have been trying out solid and i keep having some issues with the router, one of which is the routes tag which i believe is in the older versions but i'm using the newer one and dont really wanna downgrade... so this is my code: index.jsx:
import { render } from 'solid-js/web'
import { Router } from '@solidjs/router'
import './styles/index.css'
import App from './App.jsx'

const root = document.getElementById('root')

render(() => (
<Router>
<App />
</Router>

), root)`
import { render } from 'solid-js/web'
import { Router } from '@solidjs/router'
import './styles/index.css'
import App from './App.jsx'

const root = document.getElementById('root')

render(() => (
<Router>
<App />
</Router>

), root)`
import { createSignal } from 'solid-js'
import solidLogo from './assets/solid.svg'
import viteLogo from '/vite.svg'
import './styles/App.css'
import Home from './pages/home'
import Navbar from './components/navbar'
// import Productie from './pages/productie'
// import Over from './pages/over'
// import Historiek from './pages/historiek'
// import Contact from './pages/contact'
import { Router, Route } from "@solidjs/router";


function App() {

return (
<>
<Navbar />

<Route path="/" component={Home} />
{/* <Route path="/productie" component={Productie} />
<Route path="/over_ons" component={Over} />
<Route path="/historiek" component={Historiek} />
<Route path="/contact" component={Contact} /> */}
</>
)
}

export default App
import { createSignal } from 'solid-js'
import solidLogo from './assets/solid.svg'
import viteLogo from '/vite.svg'
import './styles/App.css'
import Home from './pages/home'
import Navbar from './components/navbar'
// import Productie from './pages/productie'
// import Over from './pages/over'
// import Historiek from './pages/historiek'
// import Contact from './pages/contact'
import { Router, Route } from "@solidjs/router";


function App() {

return (
<>
<Navbar />

<Route path="/" component={Home} />
{/* <Route path="/productie" component={Productie} />
<Route path="/over_ons" component={Over} />
<Route path="/historiek" component={Historiek} />
<Route path="/contact" component={Contact} /> */}
</>
)
}

export default App
please help i keep getting this error: utils.js?v=22cc6010:29 Uncaught Error: <A> and 'use' router primitives can be only used inside a Route.
11 replies