Skip to content

got url.replace is not a function #140

Description

@Edorka

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 ? url.href : url;
		return require('node-fetch')(target.replace(/^\/\//g,'https://'), opts);
	})
);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions