-
Notifications
You must be signed in to change notification settings - Fork 168
Doesn't work with Microsoft's FluentUI #75
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
Comments
@FallingSnow Is the component a page or just a component which is used in a page? If it is a component which is used in a page could you share the page it is used in? |
It was used in a page. I've created a minimal repo where there is only 2 additions, the import and usage. |
It seems to be that the reason that the SPA mode is failing is because |
maybe we can add ssr support in |
Oh you're right, if you remove Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
at resolveDispatcher (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react.development.js:790:31)
at useEffect2 (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react.development.js:816:66)
at useFocusRects (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:2687:5)
at FocusRects (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/@fluentui/[email protected]/es2018/react.development.js:2713:37)
at renderWithHooks (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:9106:32)
at mountIndeterminateComponent (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:10439:29)
at beginWork (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:11215:32)
at HTMLUnknownElement.callCallback2 (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:2701:97)
at Object.invokeGuardedCallbackDev (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:2724:34)
at invokeGuardedCallback (http://localhost:8080/_aleph/-/cdn.esm.sh/v13/[email protected]/es2018/react-dom.development.js:2751:151) Could this be caused because there are two different reacts imported when doing import React, { useState } from 'https://esm.sh/react'
import { PrimaryButton } from 'https://esm.sh/@fluentui/react' |
@FallingSnow Yeah, it is probably because of 2 different React's being pulled in. @ije and I discussed this in #59, and we decided that a |
I don't think it does. I'm using the following and the error remains. import React, { useState } from 'https://esm.sh/[email protected]?dev'
import { PrimaryButton } from 'https://esm.sh/@fluentui/[email protected]' |
@FallingSnow I don't believe |
Oh, I see. Thanks for pointing that out. For what it's worth, I tried loading with jspm and got the same error. Skypack gave me this error, which seems completely off ( Uncaught (in promise) SyntaxError: The requested module '../../@fluentui/[email protected]/dist=es2020,mode=raw/lib/dateMath/dateMath.js' does not provide an export named 'BaseExtendedPeoplePicker' |
import React, { useState } from 'https://esm.sh/react'
import { PrimaryButton } from 'https://esm.sh/@fluentui/[email protected]' does this work? |
since aleph uses react 17.0.1 as default. |
and please try to delete the |
Easy peasy lemon squeezy, works! Wow that was rather painless and simple. Thanks! |
cool! |
Should point out that while in SSR mode, you still get the following in the console. It also flashes in the browser when first loading the page, then disappears and displays normal. ERROR TypeError: head.insertBefore is not a function
at Stylesheet6._createStyleElement (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v14/@fluentui/[email protected]/[email protected]/es2018/react.development.js:177:22)
at Stylesheet6._getStyleElement (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v14/@fluentui/[email protected]/[email protected]/es2018/react.development.js:151:39)
at Stylesheet6.insertRule (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v14/@fluentui/[email protected]/[email protected]/es2018/react.development.js:120:67)
at applyRegistration (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v14/@fluentui/[email protected]/[email protected]/es2018/react.development.js:532:29)
at styleToClassName (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v14/@fluentui/[email protected]/[email protected]/es2018/react.development.js:545:9)
at mergeCss (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v14/@fluentui/[email protected]/[email protected]/es2018/react.development.js:561:22)
at mergeStyles (file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v14/@fluentui/[email protected]/[email protected]/es2018/react.development.js:555:12)
at file:///home/ayrton/Coding/node/mmes/server/.aleph/development.es2018/-/cdn.esm.sh/v14/@fluentui/[email protected]/[email protected]/es2018/react.development.js:1247:31 Nether is experienced when using |
maybe you need the Asynchronous Import . |
Does this mean I'd have to use |
I'm facing the same issue with Material-UI. I replaced "external" to "deps", and it worked. Maybe the "external" hasn't been implemented yet. |
@c0per |
Component:
Console:
Browser:
If you use
"ssr": false, // SPA mode
you still end up with the same browser error message. But no console error message.The text was updated successfully, but these errors were encountered: