File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,13 +48,13 @@ const ChaynsProvider: React.FC<ChaynsProviderProps> = ({
4848 if ( data && functions ) {
4949 customWrapper . current = new ModuleFederationWrapper ( data , functions , customFunctions ) ;
5050 } else {
51- console . warn ( ' ModuleFederationWrapper requires data and functions') ;
51+ console . error ( '[chayns-api] ModuleFederationWrapper requires data and functions') ;
5252 }
5353 } else if ( isServer ) {
5454 if ( data && functions ) {
5555 customWrapper . current = new SsrWrapper ( data , functions , customFunctions ) ;
5656 } else {
57- console . warn ( ' SsrWrapper requires data and functions') ;
57+ console . error ( '[chayns-api] SsrWrapper requires data and functions') ;
5858 }
5959 } else {
6060 const deviceInfo = getDeviceInfo ( navigator . userAgent , '' ) ;
@@ -66,8 +66,10 @@ const ChaynsProvider: React.FC<ChaynsProviderProps> = ({
6666 }
6767 }
6868 moduleWrapper . current = customWrapper . current ;
69- chaynsApis [ idRef . current ] = customWrapper . current . functions ;
70- customWrapper . current . chaynsApiId = idRef . current ;
69+ if ( customWrapper . current ) {
70+ chaynsApis [ idRef . current ] = customWrapper . current . functions ;
71+ customWrapper . current . chaynsApiId = idRef . current ;
72+ }
7173 }
7274
7375 const [ isInitialized , setIsInitialized ] = useState < boolean > ( ! ! customWrapper . current ?. values ) ;
You can’t perform that action at this time.
0 commit comments