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

Can't find stylesheet to import #1651

Open
stag-enterprises opened this issue Dec 14, 2024 · 7 comments
Open

Can't find stylesheet to import #1651

stag-enterprises opened this issue Dec 14, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@stag-enterprises
Copy link

On a fresh install & build of Quartz, running the build task fails with

 Quartz v4.4.0

✘ [ERROR] Error: Can't find stylesheet to import.
  ╷
1 │ @use "variables.scss" as *;
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  ../../../../quartz/styles/base.scss 1:1  @use
  - 1:1                                    root stylesheet [plugin sass-plugin]

    quartz/plugins/emitters/componentResources.ts:8:19:
      8 │ import styles from "../../styles/custom.scss"
        ╵                    ~~~~~~~~~~~~~~~~~~~~~~~~~~

Couldn't parse Quartz configuration: ./quartz/build.ts
Reason: Error: Build failed with 1 error:
quartz/plugins/emitters/componentResources.ts:8:19: ERROR: [plugin: sass-plugin] Error: Can't find stylesheet to import.
  ╷
1 │ @use "variables.scss" as *;
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  ../../../../quartz/styles/base.scss 1:1  @use
  - 1:1                                    root stylesheet
error: script "quartz" exited with code 1

Compiling quartz/styles/custom.scss manually using npx sass works fine, so I'm pretty sure it's an issue with esbuilds-sass-plugin.

@stag-enterprises stag-enterprises added the bug Something isn't working label Dec 14, 2024
@aarnphm
Copy link
Collaborator

aarnphm commented Dec 18, 2024

I'm confused how did you run into this issue?

If you do npm i and npx quartz build --serve without any modification, it should just work?

@stag-enterprises
Copy link
Author

Weird, it doesn't seem to be working for me. I didn't make any changes to the repo, just cloning it and npx quartz build

@saberzero1
Copy link
Collaborator

saberzero1 commented Dec 19, 2024

Weird, it doesn't seem to be working for me. I didn't make any changes to the repo, just cloning it and npx quartz build

Is there a quartz/styles/variables.scss file in your repo?

Are there pending changes? git status

@stag-enterprises
Copy link
Author

Is there a quartz/styles/variables.scss file in your repo?

Yes

Are there pending changes? git status

Just the default template files in content

@saberzero1
Copy link
Collaborator

Is there a quartz/styles/variables.scss file in your repo?

Yes

Are there pending changes? git status

Just the default template files in content

Can you try to do a clean install?

npm ci.

If building doesn't work after that, can you provide the output of these commands?

  • node --version (Gets Node.js version)
  • npm --version (Gets Node package manager version)
  • npm list --depth=0 (Gets installed NPM packages with versions (without full dependency graph))

@Carnia
Copy link

Carnia commented Dec 30, 2024

Is there a quartz/styles/variables.scss file in your repo?

Yes

Are there pending changes? git status

Just the default template files in content

Can you try to do a clean install?

npm ci.

If building doesn't work after that, can you provide the output of these commands?

  • node --version (Gets Node.js version)
  • npm --version (Gets Node package manager version)
  • npm list --depth=0 (Gets installed NPM packages with versions (without full dependency graph))

I used pnpm (node22, npm10), and this issue also occurred. After switching to npm, it returned to normal. Can you support pnpm?

@aarnphm
Copy link
Collaborator

aarnphm commented Dec 31, 2024

imo if you want to switch to pnpm then you have to also update the package.json for the script itself.

This decision I will refer back to Jacky's decision. I don't have strong opinion/fluent enough in the JS ecosystem to have opinion on supporting multiple tools.

fwiw this can also be applied everywhere (even in Python ecosystem), where the decision of the repo should just to follow one tool for build system (in this case, npm is the most battle tested, albeit there are faster option out there, including bun or deno).

Upgrading to a different build tool requires changes to the core, which I don't think we have bandwidth atm. So if you want to propose a faster build tool, then by all means I'm all ear, as long as Jacky agrees with it.

tbh I don't find any problem with npm at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants