Dart-sass snap filesystem permissions

Just in case someone else runs into this issue we have spent some time unravelling, the dart-sass snap (and all snaps) only has access on the filesystem to the /etc and /home directories, so any files you are including outside of those will not be able to be read in (dart-sass reports this compile issue with a rather terse error message).

Resolution is to either use the pre-built dart-sass binary or, as suggested in How to give snaps access to /somedir - Ask Ubuntu, use bind mounts.

1 Like

To clarify…

The Dart Sass snap package for Linux is, by design, strictly confined; it cannot access /etc.

$ snap connections dart-sass

Interface  Plug            Slot   Notes
home       dart-sass:home  :home  -

To enable or revoke access to removable media:

$ sudo snap connect dart-sass:removable-media
$ sudo snap disconnect dart-sass:removable-media

If you need access to other portions of the file system, install a prebuilt binary or use Homebrew. See details.

Snap packages are either “strictly” confined or “classically” confined. Classically confined snap packages such as Go, Node.js, and VS Code have full system access—because they need it more often than not.

Many snap packages are “strictly” confined, but with exceptions granted by the Snap Store based on need and trust. For example, Hugo’s snap package has access to various dot files in a user’s home directory to enable integration with Git, GitHub, AWS, Azure, and Google Cloud.