Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imported Sass files are not recompiled when changed after initial build #613

Closed
3 tasks done
DriesOeyen opened this issue Oct 26, 2018 · 2 comments
Closed
3 tasks done

Comments

@DriesOeyen
Copy link

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

We just bumped into a variation of electron-userland/electron-forge-templates#55, but suspect it might be an issue with Electron Forge's core rather than the templates. Please refer to this issue for a full description of the problem. As a recap of that post: the Electron Forge toolchain appears to exhibit a caching issue that prevents imported Sass files from being recompiled when they're changed, even though the import is successfully compiled during the first build.

This issue happens for us when @importing a Sass file (eg: global.scss) from the style segment of a Vue single-file component (component.vue). In the issue referenced above, the OP seems to encounter the same issue from vanilla HTML and Sass files. Unlike that person's experience however, it doesn't matter for us whether the Sass file is a partial (_global.scss) or not (global.scss). Both are incorrectly cached during subsequent builds.

Behavior is as follows: the compiler will correctly perform an initial compilation when first encountering the @import statement, but further changes to the Sass file are not reflected in subsequent builds at all because the compiler keeps using a cached version of the file.

We know this is a caching issue because removing Electron Forge's cache folder and recompiling afterwards will make the changes to the imported Sass file show up. However, in order to make subsequent changes show up the cache folder needs to be removed over and over again manually. This is not ideal and appears to be a bug somewhere in the Electron Forge toolchain.

For people ending up here via Google looking for a quick fix, the cache folder can be removed like this:

# Remove the cache folder
$ rm -r $TMPDIR/compileCache_  # … and hit tab to complete the path, it contains a UUID

# Run/build the app again
$ electron-forge start

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +409ms
  electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Locating Application +0ms
  electron-forge:project-resolver searching for project in: /home/user/Workspace/project +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in /home/user/Workspace/package.json +4ms
  electron-forge:lifecycle Process Succeeded: Locating Application +5ms
  electron-forge:lifecycle Process Started: Preparing native dependencies +5ms
  electron-forge:lifecycle Process Succeeded: Preparing native dependencies +345ms
  electron-forge:hook could not find hook: generateAssets +0ms
  electron-forge:lifecycle Process Started: Launching Application +2ms
  electron-forge:lifecycle Process Succeeded: Launching Application +3ms

What command line arguments are you passing?

None

What does your config.forge data in package.json look like?

      "make_targets": {
        "linux": [
          "zip"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "yarn"
      }

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init is a good starting point, if that is not the
source of your problem.

@malept
Copy link
Member

malept commented Oct 26, 2018

This is a duplicate of #182.

@malept malept closed this as completed Oct 26, 2018
@DriesOeyen
Copy link
Author

Hmm, I reviewed that issue both before creating this one and again just now.
It doesn't appear to be describing the same behavior. So I'm not sure why this is being labeled as a duplicate.

Look, if I need to raise this elsewhere: feel free to let me know. I understand this could be caused by a dependency rather than Electron Forge itself, but it's not clear to me which that might be because I'm not familiar with all the components that make Forge tick. Thanks for your patience.

dsanders11 pushed a commit that referenced this issue Jan 14, 2023
A minor refactor to getIsDownloaded(), which is async only because it
uses fancy-import. However this isn't necessary in order for testing, so
the code can be simplified a little by removing 'async'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants