Skip to content

Commit 588df2d

Browse files
Add a troubleshoot section to the readme
1 parent 400f1f8 commit 588df2d

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,55 @@ and want to switch to dartsass-rails, follow these instructions below:
6363
bundle exec rails dartsass:build
6464
```
6565
66+
## Troubleshooting
67+
68+
Some common problems experienced by users ...
69+
70+
### LoadError: cannot load such file -- sassc
71+
72+
The reason for the above error is that Sprockets is trying to build Sass files
73+
but the sass-rails or sassc-rails gems are not installed. This is expected,
74+
since Dart Sass is used instead to build Sass files, and the solution is
75+
to make sure that Sprockets is not building any Sass files.
76+
77+
There are three reasons for why this error can occur:
78+
79+
#### Sass files are referenced in the Sprockets manifest file
80+
81+
If any Sass files are referenced in the Sprockets manifest file
82+
(`app/assets/config/manifest.js`) Sprockets will try to build the Sass files and
83+
fail.
84+
85+
##### Solution
86+
87+
Remove any references to Sass files from the Sprockets manifest file. These are
88+
now handled by Dart Sass. If you have more Sass files than `application.scss`,
89+
make sure these are compiled by Dart Sass
90+
(see [Configuring builds](#configuring-builds) above).
91+
92+
#### Running locally
93+
94+
If you receive this error when running the Rails server locally and have
95+
already removed any references to Sass files from the Sprockets manifest file,
96+
the Dart Sass process is most likely not running.
97+
98+
##### Solution
99+
100+
Make sure the Dart Sass process is running by starting the Rails sever by
101+
running: `./bin/dev`.
102+
103+
#### Running continues integration pipelines
104+
105+
If you receive this error when running tests that interacts with the browser in
106+
a continues integration pipeline and have removed any references to Sass files
107+
from the Sprockets manifest file, the Sass files have most likely not been
108+
built.
109+
110+
##### Solution
111+
112+
Add a step to the continues integration pipeline to build the Sass files with
113+
the following command: `bundle exec rails dartsass:build`.
114+
66115
## Version
67116
68117
Dart Sass 1.49.0

0 commit comments

Comments
 (0)