Can't compile project with Ktor JS client because of webpack errors
See original GitHub issueKtor Version and Engine Used (client or server and name) io.ktor:ktor-client-js 1.3.0-beta-1 and 1.2.5
Describe the bug Webpack “Module not found” errors are thrown.
Logs:
WARNING in .._imported/ktor-ktor-client-core/1.3.0-beta-1/ktor-ktor-client-core.js 12165:13-32
Critical dependency: the request of a dependency is an expression
@ ./kotlin/gaia.js
@ multi ./kotlin/gaia.js source-map-support/browser-source-map-support.js
WARNING in .._imported/ktor-ktor-client-core/1.3.0-beta-1/ktor-ktor-client-core.js
Module not found: Error: Can't resolve 'ws' in 'C:\Users\Daan\code\gaia\build\js\packages_imported\ktor-ktor-client-core\1.3.0-beta-1'
@ .._imported/ktor-ktor-client-core/1.3.0-beta-1/ktor-ktor-client-core.js
@ ./kotlin/gaia.js
@ multi ./kotlin/gaia.js source-map-support/browser-source-map-support.js
ERROR in .._imported/ktor-ktor-io/1.3.0-beta-1/ktor-ktor-io.js
Module not found: Error: Can't resolve 'text-encoding' in 'C:\Users\Daan\code\gaia\build\js\packages_imported\ktor-ktor-io\1.3.0-beta-1'
@ .._imported/ktor-ktor-io/1.3.0-beta-1/ktor-ktor-io.js 20149:21-45 20217:21-45
@ .._imported/ktor-ktor-client-json/1.3.0-beta-1/ktor-ktor-client-json.js
@ ./kotlin/gaia.js
@ multi ./kotlin/gaia.js source-map-support/browser-source-map-support.js
To Reproduce Steps to reproduce the behavior:
- Add the io.ktor:ktor-client-js dependency to a Kotlin multi-platform project
- Run ./gradlew jsBrowserWebpack
- See errors
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:10
Top Results From Across the Web
Webpack fails with 'Module not found' for Kotlin 1.5.0 and ktor ...
I'm getting the following error in my multiplatform project (see attached):. * What went wrong: Execution failed for task ':jsBrowserDevelopmentWebpack'.
Read more >nextJS build fails on Vercel because of Webpack errors
When I attempted to import a Comment component into a page I was getting Vercel build errors: Failed to compile. ./pages/{mypage.js} Module not ......
Read more >WhatsNew 1.6 | Ktor Framework
Infrastructure: Build with JDK 11 for all modules fails: Can't inline metric micrometer because it uses jvm target 8.
Read more >GraphQL Code Libraries, Tools and Services
A simple JavaScript GraphQL client,Let the *.gql file be used as a module through webpack loader. Tools. GraphiQL. GitHubgraphql/ ...
Read more >Migrating our Kotlin/JS app to the new IR compiler
The IR compiler for Kotlin/JS comes with a lot of benefits for ... all the libraries we are using in the project (including...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@edvorg Yep, that fixed it! Many thanks! I was able to perform a simple hello world with web sockets.
My
build.gradle
now looks like this:text-encoding is now unmaintained: https://www.npmjs.com/package/text-encoding