Next-routes: Incompatible with next@canary

Created on 6 Dec 2018  路  3Comments  路  Source: fridays/next-routes

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

Most helpful comment

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?

All 3 comments

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?

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

Any approach?

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidnguyen179 picture davidnguyen179  路  6Comments

adekbadek picture adekbadek  路  4Comments

arefaslani picture arefaslani  路  3Comments

ccuilla picture ccuilla  路  6Comments

jesstelford picture jesstelford  路  3Comments