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

@primer/css default import depends on @primer/view-components #2780

Closed
shiftkey opened this issue Jan 27, 2025 · 4 comments
Closed

@primer/css default import depends on @primer/view-components #2780

shiftkey opened this issue Jan 27, 2025 · 4 comments

Comments

@shiftkey
Copy link

shiftkey commented Jan 27, 2025

Describe the bug

After upgrading to 21.5.0 I am unable to import the default stylesheet:

SassError: Can't find stylesheet to import.
  ╷
1 │ @import '@primer/view-components/app/components/primer/beta/border_box';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  node_modules/@primer/css/box/box.scss 1:9      @import
  node_modules/@primer/css/box/index.scss 2:9    @import
  node_modules/@primer/css/core/index.scss 15:9  @import
  node_modules/@primer/css/index.scss 18:9       root stylesheet

21.4.0 does not have this issue, and as #2724 is the only change in that release there's a strong signal that @primer/view-components is expected on disk.

This seems to be a pattern used often in these stylesheets, so I'm not sure if I have to install @primer/view-components even if I'm not using it in a project:

Image

To Reproduce

Steps to reproduce the behavior:

  1. Install the latest versions of these components (excluding @primer/view-components) along with the @primer/css version
  "dependencies": {
    "@primer/css": "21.5.0",
    "sass": "^1.83.4",

Within a React component:

import "@primer/css/index.scss";

I can point you to an internal repro of this if you want the full environment to poke at.

Expected behavior

Application can import stylesheet without errors.

wolfy1339 added a commit to probot/probot.github.io that referenced this issue Jan 27, 2025
@joshblack
Copy link
Member

Hi @shiftkey! 👋 Thanks so much for bringing this up, can confirm the issue that you're running into and am looking into what the intended next steps are 🤔

It seems like there should not be an expectation that @primer/view-components is on disk since the project is not listing it as a dependency. It seems like we need to address this issue in the release that you noted above and also see what the expectation is for how these two projects relate in the future.

I'm going to move this back to our teams backlog for prioritization.

@sunnyi101
Copy link

sunnyi101 commented Feb 3, 2025

@shiftkey what repo/project are you working on? We can potentially help suggest other alternatives

@wolfy1339
Copy link

i am experiencing this issue over at https://github.com/probot/probot.github.io
I added @primer/view-components to get sass compilation working again

@jonrohan
Copy link
Member

jonrohan commented Feb 5, 2025

Closed by #2789

@jonrohan jonrohan closed this as completed Feb 5, 2025
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

6 participants