Skip to content

Webpacker compilation fails if all core gems are not available #8109

@ahukkanen

Description

@ahukkanen

Describe the bug
Decidim can be installed without some gems and even in the default installation, some gems are disabled by default (e.g. consultations, initiatives, elections, votings).

The decidim's application.scss stylesheet assumes all of these are available:

@import "stylesheets/decidim/accountability/accountability";
@import "stylesheets/decidim/budgets/budgets";
@import "stylesheets/decidim/conferences/conferences";
@import "stylesheets/decidim/consultations/consultations";
@import "stylesheets/decidim/initiatives/initiatives";
@import "stylesheets/decidim/elections/elections";
@import "stylesheets/decidim/votings/votings";
@import "stylesheets/decidim/proposals/proposals";
@import "stylesheets/decidim/surveys/surveys";

This would cause the asset compilation to fail.

To Reproduce
Steps to reproduce the behavior:

  1. Build the Decidim gems and install them
  2. Run the Decidim application generator
  3. Try to compile the assets
  4. See error

Expected behavior
I would expect that I can install Decidim without some modules available.

Screenshots
N/A

Stacktrace
N/A

Extra data (please complete the following information):

  • Device: (any)
  • Device OS: (any)
  • Browser: (any)
  • Decidim Version: 0.25.0.dev
  • Decidim installation: (none?)

Additional context
When we compiled the assets through asset pipeline, these assets were dynamically imported depending which gems were available:

<% Decidim.component_manifests.map(&:stylesheet).compact.each do |stylesheet| %>
@import "<%= stylesheet %>";
<% end %>
<% Decidim.participatory_space_manifests.map(&:stylesheet).compact.each do |stylesheet| %>
@import "<%= stylesheet %>";
<% end %>

Now of course we can no longer do that as we cannot use ERB with webpack.

@ferblape maybe you have some idea how to solve this? We should probably define some dynamic SCSS variable which defines the stylesheets to be imported...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions