I'm getting this error while doing a yarn build on a preact-cli project Complete message is
✖ 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);
})
);
I'm getting this error while doing a
yarn buildon 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: