question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Next.js v8

See original GitHub issue

next-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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
fridayscommented, Feb 7, 2019

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

2reactions
timneutkenscommented, Jan 9, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found