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

Importing CSS from JS file breaks incremental build #37513

Closed
2 tasks done
thierrygoldwaser opened this issue Jan 22, 2023 · 2 comments
Closed
2 tasks done

Importing CSS from JS file breaks incremental build #37513

thierrygoldwaser opened this issue Jan 22, 2023 · 2 comments
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@thierrygoldwaser
Copy link

Preliminary Checks

Description

When importing a CSS file from gatsby-browser.js as described in https://www.gatsbyjs.com/docs/how-to/styling/built-in-css/, all files are generated with each build, even if no changes.

Therefore, it seems the import CSS directive is breaking the incremental build.

Similar issue reported: https://www.reddit.com/r/gatsbyjs/comments/z37o2o/is_the_webpackcompilationhash_supposed_to_change/

Reproduction Link

https://github.com/thierrygoldwaser/gatsby-incremental-build-ko

Steps to Reproduce

  1. npm install
  2. sh ./compute-build-diff.sh

(As described in https://www.gatsbyjs.com/docs/debugging-incremental-builds/, the compute-build-diff.sh script computes a diff between 2 consecutive builds.)

Expected Result

File build-diff.diff should be empty.

Actual Result

File build-diff.diff is not empty.

Note that if you remove the import directive from gatsby-browser.js and run the same script, the build diff is now empty. Which proves that the culprit is the import directive.

Environment

System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
  Languages:
    Python: 2.7.18 - /Users/thierry/.pyenv/shims/python
  Browsers:
    Chrome: 109.0.5414.87
    Firefox: 108.0.1
    Safari: 16.2

Config Flags

No response

@thierrygoldwaser thierrygoldwaser added the type: bug An issue or pull request relating to a bug in Gatsby label Jan 22, 2023
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 22, 2023
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 23, 2023
@LekoArts
Copy link
Contributor

Hi, this is a duplicate of #33450

@LekoArts LekoArts closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
@thierrygoldwaser
Copy link
Author

Hi @LekoArts thanks, indeed I had not noticed that only the first build was impacted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants