Hildebrandt Tobias
05/22/2025, 12:01 PMpackage shared.utils.reactOdic
@JsModule("@axa-fr/react-oidc")
@JsNonModule
external val OidcProvider: react.FC<OidcProviderProps>
external interface OidcProviderProps : PropsWithChildren {
var configuration: OidcConfiguration
// all the other fields
}
external interface OidcConfiguration {
var client_id: String
// all the other fields.
}
Then I tried to use it:
val App = FC<Props> {
OidcProvider {
configuration = oidcConfig
RouterProvider { router = mainRouter }
ReactQueryDevtools { initialIsOpen = false }
}
}
But I get Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
When I do OidcProvier.create { /* *config & browser* */ }
there is no error, but also no dom changes/empty site.turansky
05/22/2025, 2:05 PM@JsModule
on file levelHildebrandt Tobias
05/23/2025, 11:25 AM@JsModule
and @JsNonModule
are required. @JsNonModule
was will in without the file
level declaration, so for some weird reason it didn't occur to me to put the @JsNonModule
also on the file level. Thanks everything works now. ❤️turansky
05/23/2025, 11:26 AMtarget = "es2015"
turansky
05/23/2025, 11:27 AM@JsNonModule
Hildebrandt Tobias
05/23/2025, 11:33 AMjs("jsFrontend", IR) {
compilerOptions {
target = "es2015"
freeCompilerArgs.add("-Xcontext-receivers")
}
}
But now I get hundreds of these errors:
Module not found: Error: Can't resolve '@mui/material/CardActions' in 'path'
Did you mean 'index.js'?
BREAKING CHANGE: The request '@mui/material/CardActions' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
turansky
05/23/2025, 11:35 AMHildebrandt Tobias
05/23/2025, 11:40 AM:jsFrontend:jsFrontendBrowserProductionWebpack
Michael Porotkin
05/23/2025, 11:42 AMconfig.module.rules.push({
test: /\.m?js$/i,
resolve: {
fullySpecified: false,
},
})
Hildebrandt Tobias
05/23/2025, 11:44 AM