We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm getting this error while doing a yarn build on a preact-cli project Complete message is
yarn build
✖ ERROR TypeError: url.replace is not a function at /home/edorka/develop/nsp/node_modules/isomorphic-unfetch/index.js:3:36
Probably this is because code doesn't expect to get URL as an object this would be a quick fix:
module.exports = global.fetch = global.fetch || ( typeof process=='undefined' ? (require('unfetch').default || require('unfetch')) : (function(url, opts) { const target = url.href ? url.href : url; return require('node-fetch')(target.replace(/^\/\//g,'https://'), opts); }) );
The text was updated successfully, but these errors were encountered:
Hiya! You're right, Unfetch isn't properly anticipating a URL object.
The fix is actually even smaller than checking .href - URL.toString() returns the URL string, so we can just do url += '' to cast it to a string.
URL.toString()
url += ''
Sorry, something went wrong.
Support URL parameters in isomorphic-unfetch
fb13c71
Fixes #140.
Successfully merging a pull request may close this issue.
I'm getting this error while doing a
yarn build
on a preact-cli project Complete message isProbably this is because code doesn't expect to get URL as an object this would be a quick fix:
The text was updated successfully, but these errors were encountered: