Hello everyone. So I'm try to get into Kotlin/JS a...
# javascript
r
Hello everyone. So I'm try to get into Kotlin/JS and have tried following the official hands on guide. It seems like the included react-youtube-lite is deprecated and even adding just makes the screen go blank when I try to access the video player. The react-youtube-lite page say we should migrate to @lite-embed/react which i tried to do but that has brought a compilation error regarding webpack 5 no longer adding polyfills:
Module not found: Error: Can't resolve 'util' in 'C:\Users\bmkil\IdeaProjects\Kotlin-Conf-React\build\js\node_modules\cacheable-lookup\source'
for a lot of
Modules
and
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.
I tried using this doc to resolve them but have had no luck so far. And resources regarding this are very scarce. Any help would be appreciated
This my ReactYoutube file;
Copy code
// ReactYoutube.kt
@file:JsModule("@lite-embed/react")
@file:JsNonModule

package explorer

import react.ComponentClass
import react.Props

@JsName("ReactYouTubeLite")
external val YoutubeLite: ComponentClass<ReactYouTubeProps>

external interface ReactYouTubeProps : Props {
    var urlOrId: String
}
And link to @lite-embed/react is this