sp-dev-fx-property-controls
sp-dev-fx-property-controls copied to clipboard
Bug fluent UI imports 617
| 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.