Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Invalid fileDependencies for SCSS partials #255

Open
electron-userland/electron-compilers
#79
@alreece45

Description

@alreece45

When using SCSS with partial imports, the proper path of the partials are not stored, resulting in an error.

For example, this works fine on the first load, but not on subsequent loads (from the cache)

@import "base"  /* _base.scss */

When loading from the cache, one will get an error like this (but with full paths):

Failed to compile src/style/index.scss: ENOENT: no such file or directory, lstat 'src/style/base.scss'
Error: ENOENT: no such file or directory, lstat 'src/style/base.scss'
    at fs.lstatSync (fs.js:902:18)
    at Object.fs.lstatSync (ELECTRON_ASAR.js:244:16)
    at Object.realpathSync (fs.js:1542:21)
    at Object.fs.realpathSync (ELECTRON_ASAR.js:321:29)
    at cachedRealpath (node_modules/electron-compile/lib/sanitize-paths.js:25:22)
    at sanitizeFilePath (node_modules/electron-compile/lib/sanitize-paths.js:52:16)
    at FileChangedCache.getCacheEntryForPath (node_modules/electron-compile/lib/file-change-cache.js:201:48)
    at node_modules/electron-compile/lib/file-change-cache.js:239:41
    at Generator.next (<anonymous>)
    at step (node_modules/electron-compile/lib/file-change-cache.js:27:191)

It should have the _base.scss as a dependent file, rather than base.scss

--

I've created a small application that reproduces the issue. It has two buttons, one that changes just the page with two buttons:

  • Reload (Broken): reloads the page, probably from the broken cache)
  • Reload (Working): modifies the scss file, then reloads (compiling the SCSS file, without error).

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