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 fluent UI imports 617 #618

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

FredrikEkstroem
Copy link

Q A
Bug fix? [X ]
New feature? [ ]
New sample? [ ]
Related issues? fixes #617

What's in this Pull Request?

Updated imports from fluent ui to respect the exports in package.json

Explanation shamelessly stolen from co pilot:
Starting from Node.js version 12, package authors can define an "exports" field in their package.json file to explicitly state which files can be imported from a package. This is intended to provide encapsulation, allowing package authors to change the internal structure of their package without affecting its public API.

Webpack 5 follows this Node.js specification, and therefore respects the "exports" field in package.json files. This means that you can only import files that are explicitly listed in the "exports" field.

Webpack 4, on the other hand, does not respect the "exports" field, and allows importing any file from a package.

So, if you're using Webpack 5 and trying to import a file that is not listed in the "exports" field of the @fluentui/react package, you will get an error. You will need to either import a file that is listed in the "exports" field, or ask the package authors to add the file you're trying to import to the "exports" field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants