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

Error: Cannot find module '@fluentui/react-shared-contexts' #184

Open
HermanNygaard opened this issue Jun 11, 2024 · 3 comments
Open

Error: Cannot find module '@fluentui/react-shared-contexts' #184

HermanNygaard opened this issue Jun 11, 2024 · 3 comments
Labels
wontfix This will not be worked on

Comments

@HermanNygaard
Copy link

Error: Cannot find module '@fluentui/react-shared-contexts'
at webpackMissingModule (emotion-hash.esm.js:55:1)
at ../../.store/@fluentui-contrib-react-headless-provider@1.0.2-0813d41f07b7b138d557/node_modules/@fluentui-contrib/react-headless-provider/lib/components/HeadlessFluentProvider/HeadlessFluentProvider.js (emotion-hash.esm.js:55:1)
at webpack_require (bootstrap:19:1)
at ./src/Components/AppContainer.tsx (App.tsx:45:1)
at webpack_require (bootstrap:19:1)
at ./src/Components/App.tsx (tracing.js:7:1)
at webpack_require (bootstrap:19:1)
at index.js:320:1
at index.tsx:5:1
at index.tsx:5:1

When trying to import HeadlessFluentProvider
import { HeadlessFluentProvider } from "@fluentui-contrib/react-headless-provider";

   "@fluentui-contrib/react-headless-provider": "^1.0.2",
   "@fluentui/react-components": "^9.46.3",
   "react": "~17.0.2",
   "react-dom": "~17.0.2",

I see the error goes away if I manually install the package and import it, but shouldn't this be a dependency of react-components?

@miroslavstastny
Copy link
Member

@fluentui-contrib/react-headless-provider should not have direct dependency on @fluentui/react-shared-contexts

@Hotell
Copy link
Contributor

Hotell commented Jul 23, 2024

. I see the error goes away if I manually install the package and import it

that works as expected. context is a peer dependency ( singleton ) - we cannot ship multiple singletons as that would explode in user land. you need to install all peerDependencies explicitly in your application.

but shouldn't this be a dependency of react-components?

it is. wondering why it's used as direct sub-package import @layershifter ?

@layershifter
Copy link
Member

but shouldn't this be a dependency of react-components?

it is. wondering why it's used as direct sub-package import @layershifter ?

Some bits of API are not available through @fluentui/react-components. We need to export them and update @fluentui-contrib/react-headless-provider to import only @fluentui/react-components.

@Hotell Hotell added the wontfix This will not be worked on label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants