You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works if you add another file to the login entry. It also works if you downgrade @roots/bud to version 5.8.3 and use enqueue() instead. However, starting at version 5.8.4 neither enqueueCss() nor enqueue() works when there is a single file.
What insights have you gained?
I suspect this Bud update below is reason why it’s failing, but I think the root cause is with Acorn.
Another option is to downgrade to Bud 5.8.3 and use enqueue().
Steps To Reproduce
Add a single CSS as an entry point in bug.config.js
Attempt to enqueue that CSS file using bundle('example')->enqueueCss();
Run bud build
Open page that should have the custom CSS file in the browser
Expected Behavior
The CSS file should have been enqueued normally.
Actual Behavior
An error was thrown
Relevant Log Output
Fatal error: Uncaught Error: Argument 1 passed to Illuminate\Support\Arr::isAssoc() must be of the type array, null given, called in /app/vendor/roots/acorn/src/Roots/Acorn/Assets/Bundle.php on line 136
in /app/vendor/illuminate/collections/Arr.php on line 406
Call stack:
Illuminate\S\Arr::isAssoc()
/app/vendor/roots/acorn/src/Roots/Acorn/Assets/Bundle.php:136
Roots\A\A\Bundle::setRuntime()
/app/vendor/roots/acorn/src/Roots/Acorn/Assets/Bundle.php:36
Roots\A\A\Bundle::__construct()
/app/vendor/roots/acorn/src/Roots/Acorn/Assets/Manifest.php:56
Roots\A\A\Manifest::bundle()
/app/vendor/roots/acorn/src/Roots/helpers.php:36
Roots\bundle()
wp-content/themes/[redacted]/app/setup.php:19
App\{closure}()
wp-includes/class-wp-hook.php:307
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:331
WP_Hook::do_action()
wp-includes/plugin.php:476
do_action()
wp-login.php:114
login_header()
wp-login.php:1383
Versions
Sage 10, Acorn 2.0.6, Bud 5.8.0
The text was updated successfully, but these errors were encountered:
When an entrypoint only contains CSS and no JS, this will cause
an error.
This fix alleviates that by adding empty arrays for all supported
entrypoint extensions when none are contained in the bundle.
closes#229
Terms
Description
What's wrong?
enqueueCss()
doesn’t work when there’s only a single CSS file as the entry point.What have you tried?
It works if you add another file to the
login
entry. It also works if you downgrade@roots/bud
to version5.8.3
and useenqueue()
instead. However, starting at version5.8.4
neitherenqueueCss()
norenqueue()
works when there is a single file.What insights have you gained?
I suspect this Bud update below is reason why it’s failing, but I think the root cause is with Acorn.
Here’s the error message:
Here’s the relevant line in
/app/vendor/roots/acorn/src/Roots/Acorn/Assets/Bundle.php:36
acorn/src/Roots/Acorn/Assets/Bundle.php
Line 136 in 53cba94
Possible solutions
I’m not super familiar with the codebase yet but I’m hoping it’s as easy as updating the line referenced above.
Temporary workarounds
Create an empty JS file and add it to the entry point:
Another option is to downgrade to Bud
5.8.3
and useenqueue()
.Steps To Reproduce
bug.config.js
bundle('example')->enqueueCss();
bud build
Expected Behavior
The CSS file should have been enqueued normally.
Actual Behavior
An error was thrown
Relevant Log Output
Versions
Sage 10, Acorn 2.0.6, Bud 5.8.0
The text was updated successfully, but these errors were encountered: