SorinSologics2019SorinSologics2019 MemberComments: 11 Received thanks: 0 Member since: July 26

Hello everybody!

We are trying to compile the standard theme using command 'php bin/console theme:compile' but we are getting this error:

php bin/console theme:compile
Start theme compilation
07:53:49 ERROR     [console] Error thrown while running command "theme:compile". Message: "Undefined variable $spacer: /../vendor/shopware/storefront/Resources/src/style/abstract/variables/_custom.scss on line 19, at column 1" ["exception" => ScssPhp\ScssPhp\Exception\CompilerException^ { …},"command" => "theme:compile","message" => "Undefined variable $spacer: /../vendor/shopware/storefront/Resources/src/style/abstract/variables/_custom.scss on line 19, at column 1"]

In Compiler.php line 4184:

Undefined variable $spacer: /../vendor/shopware/storefront/Resources/src/style/abstract/variables/_custom.scss on line 19, at column 1

theme:compile [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--]

 

We did check the file and the variable is missing. If we add it and try to compile again another errors are thrown(mix-in...). 

The zip file from the site is already coming with the theme compiled. 

Seems that the .scss files for default theme are incomplete in vendor.

Does anyone have an ideea how to achieve compilation of the standard theme?

Best regards,

Sorin Fistoc
 

Comments

  • Jens_KJens_K MemberComments: 52 Received thanks: 31 Member since: March 2017

    Hello,

     

    the error you describe occurs if Shopware is unable to resolve the bootstrap dependency. The spacer variable and the mix-in is normally defined by bootstrap. Are you using the installation package from our website or have you checked out the code from GitHub?

    Which command prior to bin/console theme:compile have you executed?

  • SorinSologics2019SorinSologics2019 MemberComments: 11 Received thanks: 0 Member since: July 26

    Hello,

    Thank you for the quick answer.

    We are using the installation package from your website. 

    We tried to execute bin/console theme:refresh before.

  • SorinSologics2019SorinSologics2019 MemberComments: 11 Received thanks: 0 Member since: July 26

    Hello,

    I've tried to run this commands:

    npm --prefix vendor/shopware/storefront/Resources/ clean-install    [this worked and installed all dependencies]

    I've tried after that to run again 'bin/console theme:compile' but I get the same error.

    Based on installation steps from developer edition I've runned this command too:

    npm --prefix vendor/shopware/storefront/Resources/ run production

    This is throwing the following error:

    Error: Cannot find module '@shopware/webpack-copy-after-build'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
        at Function.Module._load (internal/modules/cjs/loader.js:562:25)
        at Module.require (internal/modules/cjs/loader.js:690:17)
    ..................

    Can anyone help on this issue?

    Thank you in advance and best regards,

    Sorin

  • SorinSologics2019SorinSologics2019 MemberComments: 11 Received thanks: 0 Member since: July 26

    Hello everybody!

    I finnally managed to get it work and I'll post the solution here:

    After a clean project git setup(from github) or from the installation zip file available on the site(but using the .gitignore file from github) following steps must be done:

    1. Install administration dependencies:

    npm clean-install --prefix vendor/shopware/administration/Resources

    npm clean-install --prefix vendor/shopware/administration/Resources lerna -- bootstrap

    2. Build administration:

    php bin/console bundle:dump
    PROJECT_ROOT=__ABSOLUTE_PATH_TO_PROJECT_ROOT__ npm run --prefix vendor/shopware/administration/Resources/administration/ build
    php bin/console assets:install

    3. Install storefront dependencies:

    npm --prefix vendor/shopware/storefront/Resources/ clean-install
    node vendor/shopware/storefront/Resources/copy-to-vendor.js

    4. Build storefront:

    php bin/console bundle:dump
    PROJECT_ROOT=__ABSOLUTE_PATH_TO_PROJECT_ROOT__/ npm --prefix vendor/shopware/storefront/Resources/ run production
    php bin/console theme:compile
    php bin/console assets:install

    5. Change theme:

    php bin/console theme:change Storefront --all

    Running 'PROJECT_ROOT=__ABSOLUTE_PATH_TO_PROJECT_ROOT__/ npm --prefix vendor/shopware/storefront/Resources/ run' you'll see options like 'watch'

    If 'clean-install' doesn't work try to use 'install' instead.

     

    Best regards,

    Sorin

     

Sign In or Register to comment.