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.

Error: url.replace is not a function

See original GitHub issue

Bug report

yarn start and getting error . Same error with css plugin, So I think if this error happens not just in html webpack plugin then it can be related to Webpack

https://github.com/webpack-contrib/mini-css-extract-plugin/issues/793

What is the current behavior?

image

If the current behavior is a bug, please provide the steps to reproduce.

  1. yarn start
  2. wait for build

What is the expected behavior?

No error

Other relevant information: webpack version: “5.46.0” html-webpack-plugin: “5.3.2”, Node.js version: 14.17.1 Operating System: windows 11 wsl 2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
olegKusovcommented, Jul 23, 2021

Maybe you can provide reproducible test repo too? Because it should be work

Ok! Give me some time!

0reactions
alexander-akaitcommented, Aug 2, 2021

Problem here:

{
    test: /\.svg$/,
    use: ['@svgr/webpack', 'url-loader'],
    type: 'javascript/auto',
  },

you need to use:

{
    test: /\.svg$/,
    exclude: /favicon\.svg$/,
    use: ['@svgr/webpack', 'url-loader'],
    type: 'javascript/auto',
  },

otherwise ../src/assets/icons/favicon.svg generate svgr output i.e. URL and react component, but it can be used inside HTML file

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: TypeError: url.replace is not a function #731 - GitHub
Location: webpack:///./node_modules/css-loader/lib/url/escape.js?
Read more >
var.replace is not a function - javascript - Stack Overflow
I'm using the below code to try to trim the string in Javascript but am getting the error mentioned in ...
Read more >
TypeError: replace is not a function in JavaScript | bobbyhadz
The "replace is not a function" error occurs when we call the replace() method on a value that is not of type string...
Read more >
TypeError: replace is not a function in JavaScript - Java2Blog
TypeError : .replace is not a function occurs when we call replace() function on object which is not an string. replace() function can...
Read more >
Fixed - Uncaught TypeError: a.replace is not a function
Change log: Prevent a JS error related to app badge updates if the input value isn't the expected type.
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