Default fetch polyfill breaks ky-universal
See original GitHub issueBug report
I use ky-universal
, which is built on top of node-fetch
. After upgrading to Next.js 9.4, it has started throwing "Only absolute URLs are supported"
errors on the Node.js side, even though an absolute URL is set and it works on Next.js 9.3.x.
To Reproduce
- Use
ky-universal
in a Next.js project to make a request on the server side. - Watch it throw a
"Only absolute URLs are supported"
error.
Expected behavior
Shouldn’t throw an error, and should work like it did in Next.js 9.3.x.
System information
- OS: macOS
- Version of Next.js: 9.4.0
- Version of Node.js: 14.1.0
Additional context
It looks like the default polyfill is interfering with the library somehow, but I can’t figure out what/how. Also, pasting from https://github.com/zeit/next.js/pull/12353#issuecomment-627064091 —
node-fetch
has an upcoming v3 release (in beta now) that fixes a long-standing issue, andky-universal
is in the process of using it in their next release, which is vital when working with large API payloads.
Similar reports —
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:13 (6 by maintainers)
Top Results From Across the Web
fetch polyfill breaks ky-universal #12761 - vercel/next.js - GitHub
Default fetch polyfill breaks ky-universal #12761 ... Use ky-universal in a Next.js project to make a request on the server side.
Read more >Ky-universal: Universal HTTP Client Based on Fetch - Morioh
For older browsers, you will need to transpile and use a fetch polyfill. ... When using Ky, the default highWaterMark is set to...
Read more >Polyfilling the Fetch API for Old Browsers and Node.js
First some definitions. A polyfill will try to emulate certain APIs, so can use them as if they were already implemented. A transpiler...
Read more >wretch - npm Package Health Analysis - Snyk
A tiny wrapper built around fetch with an intuitive syntax. For more information about how to use this package see README · Ensure...
Read more >axios Alternatives - Node.js HTTP | LibHunt
9.6 0.0 L3 axios VS window.fetch polyfill ... ky-universal ... const axios = require('axios').default; // Make a request for a user with a ......
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
@timneutkens Thanks, I can confirm that this is fixed and
ky-universal
works fine on9.4.1-canary.1
.Hey! Thanks for the report, I’ve fixed the issue here: #12804