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

[Bug]: Cannot import tokens from @fluentui/react-theme-sass #26847

Closed
2 tasks done
miroslavstastny opened this issue Feb 14, 2023 · 1 comment · Fixed by #27274
Closed
2 tasks done

[Bug]: Cannot import tokens from @fluentui/react-theme-sass #26847

miroslavstastny opened this issue Feb 14, 2023 · 1 comment · Fixed by #27274

Comments

@miroslavstastny
Copy link
Member

Library

React Components / v9 (@fluentui/react-components)

System Info

-

Are you reporting Accessibility issue?

no

Reproduction

Bug Description

In App.scss, import tokens:

@import "~@fluentui/react-theme-sass";

Build fails:

ERROR in ./src/App.scss (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[2]!./node_modules/resolve-url-loader/index.js??ruleSet[1].rules[1].oneOf[7].use[3]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[4]!./src/App.scss)

Logs

No response

Requested priority

Normal

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@miroslavstastny
Copy link
Member Author

This is caused by package exports in package.json:

  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./lib/index.js",
      "require": "./lib-commonjs/index.js",
    },
    "./package.json": "./package.json"
  }

When I remove the exports completely, or add a nonsense entry to "." which points to sass/tokens.scss, it starts to work.

@miroslavstastny miroslavstastny self-assigned this Feb 14, 2023
@layershifter layershifter self-assigned this Mar 16, 2023
@msft-fluent-ui-bot msft-fluent-ui-bot added Status: Fixed Fixed in some PR and removed Status: In PR labels Apr 12, 2023
@microsoft microsoft locked as resolved and limited conversation to collaborators May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants