OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce v4.1.0-rc3 – Error with asset build step when applying custom theme

This topic contains 4 replies, has 2 voices, and was last updated by  peeush 4 years, 3 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #41184

    peeush
    Participant

    Hi

    I am trying out the latest version 4.1.0-rc3 build, which installs fine (although the images on slider are throwing 404). When I try to install my custom theme, which works fine on v 3.1.x (as well as 4.1.0-rc1), now is failing at asset build steps with the following error:

    I tried reinstalling node modules and building assets, but I get the same error. Equally, I searched the latest documentation (4.1-beta) and all I could find different for custom themes is that requireJS configuration is replaced with JSmodules now (I made the changes and removed the bin/console oro:requirejs:build step), but these build errors are only for CSS.

    Please advise.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #41214

    peeush
    Participant

    Looking into this further, I see that all the import directives in the generated styles.css.scss file in /usr/share/nginx/html/oroapp/public/layout-build/tbazui/css/layout/tbazui folder have been prefixed with ./../../../ – for example:

    This seems to be incorrect as the import directives need to be prefixed with ./../../../../ (i.e. one more directory level up) to make them work – is this being caused by an incorrect webpack config? How can I get it fixed?

    Thanks!

    PS. I had it last working in 4.1.0-beta and not 4.1.0-rc1 as I mistakenly noted earlier.

    #41215

    Andrey Yatsenko
    Moderator

    Hi Peeush,

    You can compare your webpack config with https://github.com/oroinc/orocommerce-application/blob/4.1.0-rc3/webpack.config.js to make sure it’s correct, but there were no changes since 4.1.0-beta.

    Probably you were affected by changes done in scope of webpack migration. In “assets.yml” files handling of “output” configuration value was changed. Now there should be a related link with two-level depth.
    Here is an example from blank theme.

    Before:
    output: 'css/layout/blank/styles.css'
    After
    output: 'css/styles.css'

    We’ll add this to the changelog. Thank you for the detailed report!

    #41227

    peeush
    Participant

    Thanks a ton for your help Andrey! As you suggested, changing the output configuration value in assets.yml file fixes the issue with asset build step and now my custom theme is getting compiled.

    Unfortunately though, looks like my JSModule file is not working now – this is what I had in my simple requirejs.yml file earlier:

    and this is what I changed it to in my new jsmodules.yml file:

    I realise that I need to add owlCarousel to shim section, but I was throwing errors during asset build step so took the following lines out:

    Can you please advise if I need to make any changes to my jsmodules.yml file and how do I compile these custom JS modules during the asset build process.

    Thanks

    #41230

    peeush
    Participant

    Figured out the issue with my jsmodules.yml file; below is the updated version that builds fine, but I cannot still find my JS anywhere…

    Any ideas how to get my JS working in the theme?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The forum ‘OroCommerce’ is closed to new topics and replies.

Back to top