Skip to content

When reading from webpack5 filesystem cache imported assets from css are not found #655

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

Closed
piecyk opened this issue Nov 10, 2020 · 13 comments · Fixed by #656
Closed

When reading from webpack5 filesystem cache imported assets from css are not found #655

piecyk opened this issue Nov 10, 2020 · 13 comments · Fixed by #656

Comments

@piecyk
Copy link
Contributor

piecyk commented Nov 10, 2020

  • Operating System: macOS
  • Node Version: 12.14.1
  • NPM Version: 6.13.4
  • webpack Version: 5.4.0
  • mini-css-extract-plugin Version: 1.3.0

Expected Behavior

When webpack is running from cache, output is the same as without.

Actual Behavior

When reading from cache assets imported from css are not found.

Code

https://github.com/piecyk/mini-css-extract-plugin-asset-cache-bug

How Do We Reproduce?

  1. checkout mini-css-extract-plugin-asset-cache-bug
  2. yarn webpack
  3. checkout output from ./dist
./dist/
├── index.html
├── main.css
├── main.js
└── static
    └── webpack-logo.svg
  1. rm -rf ./dist/
  2. yarn webpack
  3. checkout output from ./dist
./dist/
├── index.html
├── main.css
└── main.js
@alexander-akait
Copy link
Member

alexander-akait commented Nov 11, 2020

Yep, bug, mini-css-extract-plugin doesn't work with asset modules, critical, need to fix

@piecyk
Copy link
Contributor Author

piecyk commented Nov 12, 2020

Hmm hard to say where or how to start with this 🤔 Obvious workaround is to use file-loader/url-loader rather new assets. Also if someone want's to have a look added testes cases https://github.com/piecyk/mini-css-extract-plugin/tree/bugfix/655 can use this as base branch.

@alexander-akait
Copy link
Member

I will send a fix today

@alexander-akait
Copy link
Member

Hope, we don't break anything, anyway there is one way to check, release it 😄

@alexander-akait
Copy link
Member

@piecyk
Copy link
Contributor Author

piecyk commented Nov 13, 2020

@evilebottnawi works! Thanks 👏

@Varedis
Copy link

Varedis commented Nov 20, 2020

This seems to have broken Webpack 4 compatibility.

v1.3.0 works with Webpack 4
v1.3.1 does not

@alexander-akait
Copy link
Member

@Varedis when you speak it is broken please provide reproducible test repo, hard to say what is not working

@alexander-akait
Copy link
Member

We have tests for v4 and all works fine, hard-source-webpack-plugin will be never compatibility with this

@Varedis
Copy link

Varedis commented Nov 20, 2020

Maybe this helps, I don't really have the time to make a test repo at the minute, sorry:

using [email protected] and [email protected]:

image

Using [email protected] with the same webpack version and exactly same config works fine.

@alexander-akait
Copy link
Member

Please update webpack@4 to the latest stable version

@alexander-akait
Copy link
Member

i.e. 4.44.2

@alexander-akait
Copy link
Member

We try to avoid supporting old version of webpack, there are a lot of other bugs

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

Successfully merging a pull request may close this issue.

3 participants