Hi !
I'm trying to get next-routes working with TypeScript.
I have this code right now :
import Routes from 'next-routes';
const routes = new Routes();
routes
.add('about')
.add('post', '/p/:id')
export default routes;
But when I'm trying to compile I get this error :
const routes = new Routes();
^
TypeError: next_routes_1.default is not a constructor
I followed example here
Could you please help me ?
Same here. I "solved" it with:
import * as createRoutes from "next-routes"
import Routes from "next-routes"
// @ts-ignore Types are broken
const routes: Routes = createRoutes()
routes
.add("about")
export default routes
export const Link = routes.Link
export const Router = routes.Router
@prevostc Oh wow, it works ! Thanks :)
It works but requires a @ts-ignore and has pretty a bad semantic. I would like to see this fixed too :) @fridays do you accept PR on this issue?
@prevostc I agree, that's not good and should be fixed but.. It works atleast :D
@fridays I believe there's a pending PR to fix this. Can we get it merged please?
Anything happening with this?
Most helpful comment
Same here. I "solved" it with: