Closed yaroslavbr closed 3 years ago
Try to add missed setting to stylebook styles into assets.yml
like
stylebook_styles:
inputs:
- 'bundles/orocustomtheme/FrontendBundle/scss/settings/main/global-settings.scss'
output: 'css/stylebook.css'
You might find such an example in custom theme.
@ValeriyYustunyk the problem is that these variables are oro internal variables, and as I can see there is already such instruction for global-settings.scss which should include it. I also tried to add such block in my custom assets.yml but getting same error again and again.
Looks like is customization was removed $base-font-size
variable.
Did you try to bind styles without your customization?
I mean hide (comment, revert) all your own styles in assets.yml
.
I tried to revert everything as possible. Regarding the variable - $base-font-size - it is defined in oro code, and there are no customizations regarding it. For now I find out one interesting thing, seems the problem is in the includes order:
@import "./../../../bundles/oroform/default/scss/settings/global-settings"; @import "./../../../bundles/orofrontend/default/scss/settings/global-settings"; @import "./../../../bundles/orofrontend/default/scss/settings/bootstrap/variables"; @import "./../../../bundles/orofrontend/default/scss/settings/global-settings"; @import "./../../../bundles/orocustomer/default/scss/settings/global-settings"; @import "./../../../bundles/oroform/blank/scss/settings/mixins/appearance"; @import "./../../../bundles/madiafrontend/crh_theme/scss/settings/main/global-settings"; @import "./../../../bundles/madiafrontend/crh_theme/scss/settings/_mixins"; @import "./../../../bundles/madiafrontend/crh_theme/scss/settings/main/global-settings"; @import "./../../../bundles/madiatheme/scss/settings/partials/_sizes"; @import "./../../../bundles/madiatheme/scss/settings/main/_fluid"; @import "./../../../bundles/madiaui/crh_theme/scss/settings/global-settings"; @import "./../../../bundles/madiafrontend/crh_theme/scss/settings/main/global-settings"; @import "./../../../bundles/madiafrontend/crh_theme/scss/settings/_mixins"; @import "./../../../bundles/madiafrontend/crh_theme/scss/settings/main/global-settings"; @import "./../../../bundles/madiatheme/scss/settings/partials/_sizes"; @import "./../../../bundles/orocustomtheme/FrontendBundle/scss/settings/main/global-settings"; @import "./../../../bundles/oroform/default/scss/settings/global-settings"; @import "./../../../bundles/oroui/blank/scss/settings/global-settings";
Seems variable defined in file which is included later
One import is missed above of @import "./../../../bundles/oroform/default/scss/settings/global-settings"
should be included
@import "./../../../bundles/oroui/blank/scss/settings/global-settings"
.
yes, it is included in the end of the list that I send, somehow. So researching why it is that and how can I handle it, maybe play with bundle priorities
Seems the problem is not in priorities. Installed new oro application and compared styles.css.scss file content. As I can see in my application blank
theme assets are not installed. @ValeriyYustunyk maybe you know what can be the reason of such strange behaviour?
when I try to build just blank theme it is build correct, but when I build default it fails because there are no blank theme variables defined
Firstly you have to compare the contents of the stylebook.css.scss
file with the original one.
If some files from the blank
theme are absent it might mean that the custom theme did not extend from the blank theme or some files were removed.
https://doc.oroinc.com/frontend/storefront/theming/#dev-doc-frontend-layouts-theming-definition.
As I already told I compared - the problem is that blank theme assets are not present in this file.
Now I entirelly removed our custome them definition as well as all assets.yml file from our code. Running build command gives same error:
`Child blank theme: Time: 36381ms PublicPath: /build/blank/ Asset Size Chunks Chunk Names app.js 5.46 MiB app [emitted] app chunk/commons.js?version=52af1989 3.92 MiB commons [emitted] commons chunk/orocheckout.js?version=52af1989 382 KiB orocheckout [emitted] orocheckout chunk/orodatagrid.js?version=52af1989 2.03 MiB orodatagrid [emitted] orodatagrid chunk/orofilter.js?version=52af1989 492 KiB orofilter [emitted] orofilter chunk/oroform-validate.js?version=52af1989 188 KiB oroform-validate [emitted] oroform-validate chunk/oropayment.js?version=52af1989 140 KiB oropayment [emitted] oropayment chunk/oroproduct.js?version=52af1989 599 KiB oroproduct [emitted] oroproduct chunk/oroshoppinglist.js?version=52af1989 423 KiB oroshoppinglist [emitted] oroshoppinglist chunk/orostylebook.js?version=52af1989 185 KiB orostylebook [emitted] orostylebook chunk/oroui.js?version=52af1989 522 KiB oroui [emitted] oroui chunk/orouser.js?version=52af1989 346 KiB orouser [emitted] orouser chunk/oroviewswitcher.js?version=52af1989 132 KiB oroviewswitcher [emitted] oroviewswitcher chunk/orowebsiteelasticsearch.js?version=52af1989 238 KiB orowebsiteelasticsearch [emitted] orowebsiteelasticsearch chunk/polyfills.js?version=52af1989 90.6 KiB polyfills [emitted] polyfills chunk/vendors~commons.js?version=52af1989 563 KiB vendors~commons [emitted] vendors~commons chunk/vendors~orodatagrid-scroll-plugin.js?version=52af1989 903 KiB vendors~orodatagrid-scroll-plugin [emitted] vendors~orodatagrid-scroll-plugin chunk/vendors~orodatagrid.js?version=52af1989 155 KiB vendors~orodatagrid [emitted] vendors~orodatagrid chunk/vendors~oroform-validate.js?version=52af1989 878 KiB vendors~oroform-validate [emitted] vendors~oroform-validate chunk/vendors~oroproduct.js?version=52af1989 170 KiB vendors~oroproduct [emitted] vendors~oroproduct chunk/vendors~oroshoppinglistquicksearch.js?version=52af1989 81.2 KiB vendors~oroshoppinglistquicksearch [emitted] vendors~oroshoppinglistquicksearch css/stylebook.css 344 KiB css/stylebook [emitted] css/stylebook css/styles.css 1.97 MiB css/styles [emitted] css/styles stylebook-highlighter.js 165 KiB stylebook-highlighter [emitted] stylebook-highlighter
8 hidden assets Child default theme: Time: 34401ms PublicPath: /build/default/ 2 assets
ERROR in ./build/default/css/stylebook.css.scss Module build failed (from ../node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ../node_modules/sass-loader/lib/loader.js):
$color-palette: map_merge($color-palette, $default-color-palette); ^ Undefined variable: "$color-palette". in /app/public/bundles/oroform/default/scss/settings/_colors.scss (line 37, column 27) at /app/node_modules/webpack/lib/NormalModule.js:316:20 at /app/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /app/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/app/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at Object.callback (/app/node_modules/sass-loader/lib/loader.js:52:13) at Object.done [as callback] (/app/node_modules/neo-async/async.js:8069:18) at options.error (/app/node_modules/node-sass/lib/index.js:294:32) @ ./build/default/css/stylebook.scss.js 1:0-30
ERROR in ./build/default/css/styles.css.scss Module build failed (from ../node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ../node_modules/sass-loader/lib/loader.js):
$color-palette: map_merge($color-palette, $default-color-palette); ^ Undefined variable: "$color-palette". in /app/public/bundles/oroform/default/scss/settings/_colors.scss (line 37, column 27) at /app/node_modules/webpack/lib/NormalModule.js:316:20 at /app/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /app/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/app/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at Object.callback (/app/node_modules/sass-loader/lib/loader.js:52:13) at Object.done [as callback] (/app/node_modules/neo-async/async.js:8069:18) at options.error (/app/node_modules/node-sass/lib/index.js:294:32) @ ./build/default/css/styles.scss.js 1:0-27 Child custom theme: Time: 34304ms PublicPath: /build/custom/ 2 assets
ERROR in ./build/custom/css/stylebook.css.scss Module build failed (from ../node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ../node_modules/sass-loader/lib/loader.js):
$color-palette: map_merge($color-palette, $default-color-palette); ^ Undefined variable: "$color-palette". in /app/public/bundles/oroform/default/scss/settings/_colors.scss (line 37, column 27) at /app/node_modules/webpack/lib/NormalModule.js:316:20 at /app/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /app/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/app/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at Object.callback (/app/node_modules/sass-loader/lib/loader.js:52:13) at Object.done [as callback] (/app/node_modules/neo-async/async.js:8069:18) at options.error (/app/node_modules/node-sass/lib/index.js:294:32) @ ./build/custom/css/stylebook.scss.js 1:0-30
ERROR in ./build/custom/css/styles.css.scss Module build failed (from ../node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ../node_modules/sass-loader/lib/loader.js):
$color-palette: map_merge($color-palette, $default-color-palette); ^ Undefined variable: "$color-palette". in /app/public/bundles/oroform/default/scss/settings/_colors.scss (line 37, column 27) at /app/node_modules/webpack/lib/NormalModule.js:316:20 at /app/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /app/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/app/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at Object.callback (/app/node_modules/sass-loader/lib/loader.js:52:13) at Object.done [as callback] (/app/node_modules/neo-async/async.js:8069:18) at options.error (/app/node_modules/node-sass/lib/index.js:294:32) @ ./build/custom/css/styles.scss.js 1:0-27 Child view-switcher theme: Time: 34768ms PublicPath: /build/view-switcher/ Asset Size Chunks Chunk Names app.js 2.52 MiB app [emitted] app chunk/oroviewswitcher.js?version=52af1989 147 KiB oroviewswitcher [emitted] oroviewswitcher chunk/vendors~oroviewswitcher.js?version=52af1989 176 KiB vendors~oroviewswitcher [emitted] vendors~oroviewswitcher css/view-switcher.css 300 KiB css/view-switcher [emitted] css/view-switcher
In OroAssetsBuildCommand.php line 257:
Build failed.
`
The problem was in theme.yml from separate package. The was definition for default theme but without "parent" key in it. Something like this - https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/FormBundle/Resources/views/layouts/default/theme.yml
Somehow I don't know why (because all worked before) this configuration was taken directly (without merging all theme configuration) and this caused webpack can not determine parent theme so it loaded just assets from default theme (but not blank). Removing theme.yml definition helped.
@Grygir many thanks for helping to debug this problem!
Summary
After commerce update to 4.2 version and trying to rebuild assets with
oro:assets:install
command I getting strange error over and over. I already tried different approaches, different composer versions, etc, symfony-flex installed, fxp-plugin - not for composer 2 (because is not supported). Maybe you can suggests something?Steps to reproduce
oro:assets:install
Actual Result Getting error: ` Child default theme: Time: 40739ms PublicPath: /build/default/ 2 assets
Expected Result
Details about your environment
composer info | grep oro/ The "fxp/composer-asset-plugin" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. The "hirak/prestissimo" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option. oro/calendar-bundle 4.2.3 Calendar bundle for OroPlatform-based applications.See https://doc.oroinc.com/user/back-office/activities/calendar-events/ for more information. oro/commerce 4.2.5 OroCommerce - an open-source Business to Business Commerce application. \nThis package contains bundles and needs to be added as a dependency in an OroCommerce application. oro/commerce-akeneo 4.2.9 Akeneo PIM OroCommerce Connector. oro/commerce-crm 4.2.2 OroCRM integration for OroCommerce oro/commerce-crm-ee 4.2.4 OroCommerce OroCRM Enterprise Bridge oro/commerce-enterprise 4.2.4 OroCommerce Enterprise. oro/cookie-consent 4.2.2 Oro Commerce Cookie Consent oro/crm 4.2.4 OroCRM oro/crm-call-bundle 4.2.3 Oro Call Bundle oro/crm-dotmailer 4.2.2 Oro Dotmailer integration oro/crm-enterprise 4.2.3 OroCRM Enterprise oro/crm-hangouts-call-bundle 4.2.1 Oro Google Hangouts integration oro/crm-magento-embedded-contact-us 4.2.0-alpha.3 OroCRM Magento Embedded Contact Us package oro/crm-pro-ldap-bundle 4.2.1 OroCRM Pro LDAP Bundle oro/crm-task-bundle 4.2.2 Oro Task Bundle oro/crm-zendesk 4.2.2 OroCRM Zendesk Integration oro/customer-portal 4.2.4 oro/doctrine-extensions 2.0.0 Doctrine Extensions for MySQL and PostgreSQL. oro/google-tag-manager-bundle 4.2.1 Oro Google Tag Manager integration oro/gridfs-config 4.2.2 GridFS adapter configuration for Gaufrette oro/health-check-bundle 4.2.2 Oro Health Check Bundle oro/marketing 4.2.4 Oro Marketing Bundles oro/multi-host 4.2.3 Oro Multi-Host deployment support for BAP oro/oauth2-server 4.2.4 Oro OAuth 2.0 authorization and resource server for BAP oro/platform 4.2.5 Business Application Platform (BAP) oro/platform-enterprise 4.2.4 OroPlatform Enterprise oro/platform-serialised-fields 4.2.3 OroPlatform Serialized Fields oro/redis-config 4.2.2 OroRedisConfigBundle oro/twig-inspector 1.0.3 Oro Twig Inspector adds the possibility to find twig templates and blocks used for rendering HTML pages faster during development
PHP version: PHP 7.4.22
Database PostgreSQL 12
[Optional] Server operating system : Ubuntu Additional information