Hello,
First of all, loving Sage, awesome stuff
But recently I have encountered a problem which left me completely stuck, screenshot: https://nimb.ws/eV84HR
Here’s a publicly accessible link: https://exfactory.invsbl.lt/
This error has come up in few projects (both sage10 + BR) in my local environment (Valet on MacOS) after adding a package via Composer. The public link is a Plesk server, so the problem doesn’t seem to be my local environment.
First project crashed after https://github.com/generoi/sage-woocommerce
Second https://wordpress.org/plugins/spatie-ray/
Although I’m pretty sure packages themselves are not to blame. Also, both projects were just started and had almost none custom functionality. Interestingly, in neither cases, it was a first installed package, everything was working fine for a while and after adding a 4th plugin, things just stopped working.
If I comment out script enqueueing function, the error disappears:
add_action('wp_enqueue_scripts', function () {
wp_enqueue_script('sage/vendor.js', asset('scripts/vendor.js')->uri(), ['jquery'], null, true);
wp_enqueue_script('sage/app.js', asset('scripts/app.js')->uri(), ['sage/vendor.js'], null, true);
wp_add_inline_script('sage/vendor.js', asset('scripts/manifest.js')->contents(), 'before');
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_style('sage/app.css', asset('styles/app.css')->uri(), false, null);
}, 100);
I would appreciate any help, thanks a lot.
Also, here’s composer.json if that’s any help
{
"name": "roots/sage",
"type": "wordpress-theme",
"license": "MIT",
"description": "WordPress starter theme with a modern development workflow",
"homepage": "https://roots.io/sage/",
"authors": [
{
"name": "Ben Word",
"email": "ben@benword.com",
"homepage": "https://github.com/retlehs"
},
{
"name": "Scott Walkinshaw",
"email": "scott.walkinshaw@gmail.com",
"homepage": "https://github.com/swalkinshaw"
},
{
"name": "QWp6t",
"email": "hi@qwp6t.me",
"homepage": "https://github.com/qwp6t"
},
{
"name": "Brandon Nifong",
"email": "brandon@tendency.me",
"homepage": "https://github.com/log1x"
}
],
"keywords": [
"wordpress"
],
"support": {
"issues": "https://github.com/roots/sage/issues",
"forum": "https://discourse.roots.io/"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
},
"require": {
"php": "^7.3|^8.0",
"generoi/sage-woocommerce": "^0.1.4",
"roots/acorn": "2.0.0-alpha.0"
},
"require-dev": {
"filp/whoops": "^2.12",
"squizlabs/php_codesniffer": "^3.6"
},
"suggest": {
"log1x/sage-directives": "A collection of useful Blade directives for WordPress and Sage (^1.0).",
"log1x/sage-svg": "A useful SVG directive for inlining SVG's within Blade views (^1.0)."
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"lint": [
"phpcs --extensions=php --standard=PSR12 app config"
],
"post-autoload-dump": [
"Roots\\Acorn\\ComposerScripts::postAutoloadDump"
]
}
}