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.

module.generator.asset.publicPath='/' throw error

See original GitHub issue

Bug report

{
    module: {
      // mini-css-extract-plugin HookWebpackError: Invalid URL: /assets/logo.635a60f2.jpg
      generator: {
        asset: {
          publicPath: '/',
        },
      },
    },
   output:{
        publicPath:'auto'
   }
}

Actual Behavior

image

Expected Behavior

image

How Do We Reproduce?

{
    module: {
      generator: {
        asset: {
          publicPath: '/',
        },
      },
    },
   output:{
        publicPath:'auto'
   }
}
<!-- A great way to do this is to provide your configuration via a GitHub repository -->
<!-- The most helpful is a minimal reproduction with instructions on how to reproduce -->
<!-- Repositories with too many files or large `webpack.config.js` files are not suitable -->
<!-- Please only add small code snippets directly into this issue -->
<!-- https://gist.github.com is a good place for longer code snippets -->
<!-- If your issue is caused by a plugin or loader, please create an issue on the loader/plugin repository instead -->

### Please paste the results of `npx webpack-cli info` here, and mention other relevant information

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:31 (18 by maintainers)

github_iconTop GitHub Comments

3reactions
ccy303commented, Dec 23, 2021

I have the same problem. How to solve it

2reactions
vankopcommented, Apr 1, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack asset generator with publicPath not working?
I had the same problem, but i got it to work. The generator does not support publicPath. You have to use the output...
Read more >
Asset Modules - webpack
Asset Modules is a type of module that allows one to use asset files (fonts, icons, etc) without configuring additional loaders. Prior to...
Read more >
Webpack — Understanding the 'publicPath' mystery - Medium
So, we are utilizing resolve from path module. ERROR : Invalid configuration object. Webpack has been initialised using a configuration object ...
Read more >
Webpack 5 - Asset Modules - DEV Community ‍ ‍
In this article, I want to tell you about the Asset Modules - an ... which makes it possible to throw out a...
Read more >
HTML and Static Assets - Vue CLI
During build, asset links will be injected automatically. ... See also: publicPath ... vue.config.js module.exports = { chainWebpack: config ...
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