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

[10.0.0-dev] Dynamic imports leads to empty CSS bundles #2204

Closed
4 tasks done
oxyc opened this issue Jun 18, 2019 · 4 comments
Closed
4 tasks done

[10.0.0-dev] Dynamic imports leads to empty CSS bundles #2204

oxyc opened this issue Jun 18, 2019 · 4 comments

Comments

@oxyc
Copy link
Contributor

oxyc commented Jun 18, 2019

Description

In 10.0.0-dev the Dynamic Imports commit #2190 leads to empty CSS bundles.

Steps to reproduce

  1. Clone the 10.0.0-dev branch and run npm install; npm run build

Expected behavior:

 DONE  Compiled successfully in 12187ms                                                                                                                                                                                                             3:12:12 PM

                 Asset      Size               Chunks             Chunk Names
       /scripts/app.js  5.93 KiB         /scripts/app  [emitted]  /scripts/app
/scripts/customizer.js  2.65 KiB  /scripts/customizer  [emitted]  /scripts/customizer
  /scripts/manifest.js  6.08 KiB    /scripts/manifest  [emitted]  /scripts/manifest
    /scripts/vendor.js  1.33 MiB      /scripts/vendor  [emitted]  /scripts/vendor
        styles/app.css   226 KiB         /scripts/app  [emitted]  /scripts/app

Actual behavior:

 DONE  Compiled successfully in 12891ms                                                                                                                                                                                                             3:12:56 PM

                 Asset      Size                                            Chunks             Chunk Names
       /scripts/app.js  9.26 KiB                                      /scripts/app  [emitted]  /scripts/app
/scripts/customizer.js  2.65 KiB                               /scripts/customizer  [emitted]  /scripts/customizer
  /scripts/manifest.js  8.94 KiB                                 /scripts/manifest  [emitted]  /scripts/manifest
    /scripts/vendor.js  1.39 MiB                                   /scripts/vendor  [emitted]  /scripts/vendor
scripts/routes/home.js  1.13 KiB                               scripts/routes/home  [emitted]  scripts/routes/home
        styles/app.css   0 bytes  /scripts/app, /scripts/manifest, /scripts/vendor  [emitted]  /scripts/app, /scripts/manifest, /scripts/vendor

Reproduces how often:

100%

Versions

  • Node v11.6.0
  • Sage v10.0.0-dev

Additional information

I can confirm it works if I either remove extract() or remove the dynamic import.

Upstream issues:

Release notes

If your project heavily uses JavaScript dynamic imports, you may need to hold off until the release of webpack 5 early next year. There are known compile issues related to this that we cannot fix until then. Once webpack 5 is out, Mix will be updated shortly after. If you're unfamiliar with dynamic imports, then this very likely won't affect your project.

https://github.com/JeffreyWay/laravel-mix/releases/tag/v4.0.0

@retlehs retlehs added this to the 10.0.0-alpha.1 milestone Jul 16, 2019
@StefanNeuser
Copy link

@gtempesta
Copy link

This one worked for me, together with this.

@Log1x
Copy link
Member

Log1x commented Feb 29, 2020

I have removed dynamic imports until the release of Webpack 5 (which will fix this issue).

@Log1x Log1x closed this as completed Feb 29, 2020
Emanuel-23 referenced this issue Aug 9, 2020
- Refactor default styles and scripts
- Clean up default view markup
- Change `Title.php` to `Post.php` to suggest a more organized workflow (Supersedes #2320)
- Create an `App` composer to show an example of a global variable
- Add `align-wide` and `responsive-embeds` to `add_theme_support` by default
- Remove deprecated `soil-jquery-cdn` from `add_theme_support`
- Clean up docblocks project-wide
- Update linting to match the latest PSR-12 standards (e.g. the license docblocks)
- Add an appropriate `#app` wrapper to make the project ready for frameworks like Vue
- Add `laravel-mix-purgecss` for purgeCSS in production
- Add `laravel-mix-copy-watched` for asset watching & versioning
- Add `laravel-mix-wp-blocks` to handle compiling blocks
- Reduce the footprint of the default `webpack.mix.js`
- Append filetypes to asset names
- Add default block editor assets
- Add handling for the WordPress asset manifest
- Remove visual editor styling (Fixes #2269)
- Add sensible default styles and folders
- Remove unused `phpcs.xml`
- Move `sage-directives` and `sage-svg` to suggests
- Bump dependencies
- Add Brandon Nifong as an author
- Change license URI to https
- Remove unused function namespaces from setup.php
- Append filetypes to asset names
- Add default block editor assets
- Add handling for the WordPress asset manifest
- Ignore dist when running phpcs
- Change the search input class the the WP default
@evankford
Copy link

@Log1x now that webpack 5 is out, is there any plan to resolve this issue, or work I can do to help implement webpack 5?

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

6 participants