Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Issues
  • #1816
Closed
Open
Issue created Oct 29, 2020 by Administrator@rootContributor

Sprockets 4 and Webpacker Config/Wiki

Created by: niedfelj

  • What were you trying to do?

Install administrate with webpacker/sprockets 4 using the wiki

  • What did you end up with (logs, or, even better, example apps are great!)?

And error message about variables not being defined and about assets not being precompiled

  • What versions are you running?
    • Rails 6.0.3.4
    • administrate 0.14.0

It seems that the latest rails uses sass-rails 6 and sprockets 4 which creates a few issues for the current wiki instructions and webpacker.

  1. It seems the previous config/manifest.js had a line like this:
//= link_directory ../stylesheets .css

When generating the assets from administrate to modify for the webpacker js changes, it will compile all of the .css under stylesheets out of order and throw errors about things like base/form not having variables defined.

More details here https://github.com/rails/sprockets/issues/597

  1. The fix for above is to change that line to just //= link application.css, but application.css by default has this line, which ultimately causes the same problem.
*= require_tree .

In the end I got it working by having this in my manifest.js:

//= link_tree ../images
//= link application.css
//= link administrate/application.css

And removing the require_tree . from application.css

Assignee
Assign to
Time tracking