Skip to content
New issue

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

URIError: Failed to decode param '/%PUBLIC_URL%/favicon-32x32.png' #8

Open
Drafter500 opened this issue May 14, 2018 · 6 comments
Open

Comments

@Drafter500
Copy link

Drafter500 commented May 14, 2018

Hi, I updated webpack to v4, and now having this error:

URIError: Failed to decode param '/%PUBLIC_URL%/favicon-32x32.png'

In my index html I have:

<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon-32x32.png">

I've seen that now the order matters and declared the plugin after HtmlWebpackPlugin

  plugins: [
    new HtmlWebpackPlugin({
      inject: true,
      template: paths.appHtml
    }),
    new InterpolateHtmlPlugin({
      PUBLIC_URL: ''
    }),
...

What else am I missing?

@jice-lavocat
Copy link

jice-lavocat commented May 31, 2018

I'm facing the same issue, and I'm a bit stuck. Any hint on how to solve this ?
I'm trying to use it in images like so:
index.html
<img src="assets/%lang%/image.png">
webpack.config.js (extract)

new HtmlWebPackPlugin({
        template: "./src/index.html",
        filename: index.html,
      }),

...

new InterpolateHtmlPlugin({
        'LANG': 'en'
      })

Output:
Module not found: Error: Can't resolve './assets/%lang%/image.png'

@Drafter500
Copy link
Author

@tanzaho Did you try to make 'LANG' in lower case so that it matches exactly with the template?

@gregl83
Copy link

gregl83 commented Jan 24, 2019

I'm having the same issue, any luck?

@Mindo21
Copy link

Mindo21 commented Jan 27, 2019

Well, it seems that you just have to make sure that the names of folders in your app do not contain spaces...

@Mindo21
Copy link

Mindo21 commented Jan 27, 2019

And it worked for me! Just make sure that you do not use spaces in the workspace folders.

@MagnusBrzenk
Copy link

I gave up on trying to use this package directly and used the version supplied by create-react-app, which is in react-dev-utils/InterpolateHtmlPlugin. You can examine how create-react-app uses it by running npm run eject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants