Support Next.js v8
See original GitHub issuenext-routes
imports from next/link
:
https://github.com/fridays/next-routes/blob/1.4.2/src/index.js#L4
But in Next.js v8.0.0-canary.3 that file contains ESM, presumably because Next.js expects it will always be imported within a Next.js project via a Webpack build:
https://unpkg.com/next@8.0.0-canary.3/dist/client/link.js
That causes this runtime error on the server:
[redacted]/node_modules/next/dist/client/link.js:2
import { resolve, format, parse } from 'url';
^
SyntaxError: Unexpected token {
Presumably import NextRouter from 'next/router'
would have the same issue.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Blog - Next.js 8
Build-time environment configuration; Prefetch performance improvements; Smaller initial HTML size; Improved on-demand entries; Faster port ...
Read more >Upgrade Guide - Next.js
js version has been bumped from 12.0.0 to 12.22.0 which is the first version of Node.js with native ES Modules support. Upgrade React...
Read more >Edge Runtime - Next.js
The Next.js Edge Runtime is based on standard Web APIs. Learn more about the supported APIs available.
Read more >Testing | Next.js
Learn how to set up Next.js with three commonly used testing tools — Cypress, Playwright, Jest, and React Testing Library.
Read more >Blog - Next.js 13
The app directory includes support for: Layouts: Easily share UI between routes while preserving state and avoiding expensive re-renders. Server ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you! Yeah Link in the custom server doesn’t make sense, it’s not used there at all, it’s just in the same file. PR welcome
This is still on my list of things to fix on the Next.js side. However next-routes is importing next/link inside the custom server, which is slightly weird/wrong anyway.