fridays / next-routes

Universal dynamic routes for Next.js
MIT License
2.47k stars 230 forks source link

Incompatible with next@canary #262

Closed joncursi closed 1 year ago

joncursi commented 5 years ago

There appears to be a breaking change in the current canary branch of next.js that needs to be discussed / addressed here. Custom servers no longer boot up when using next-routes:

https://github.com/zeit/next.js/pull/4851#issuecomment-444821952

Enalmada commented 5 years ago

I just tried to upgrade next to canary to test some fixes and got:

import { resolve, format, parse } from 'url';
       ^
SyntaxError: Unexpected token {

Removing require("./routes") from my server.js eliminates the error.

The comment linked above has a quote from next team implying that next-routes may be doing something naughty:

It means you're doing something you shouldn't be doing in the first place, eg importing next/link in a custom server.

@fridays Is there something that next-routes could do to become compatible with next@canary?

EduardoHidalgo commented 5 years ago

I have the same issue! I had to upgrade to canary version because next has problems with now.sh.

Any approach?

timneutkens commented 5 years ago

Same issue as https://github.com/fridays/next-routes/issues/274

I've solved this on the Next.js side of things.