Skip to content

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

@shiftkey

Description

@shiftkey

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions