Felix
06/17/2024, 9:53 AMReferenceError: require is not defined
at <global>.eval (eval at AbortController(file:///mnt/agent/work/8d547b974a7be21f/ktor-client/ktor-client-core/js/src/io/ktor/client/engine/js/compatibility/Utils.kt:46:34), <anonymous>:1)
at <global>.AbortController(file:///mnt/agent/work/8d547b974a7be21f/ktor-client/ktor-client-core/js/src/io/ktor/client/engine/js/compatibility/Utils.kt:46)
at <global>.commonFetch(file:///mnt/agent/work/8d547b974a7be21f/ktor-client/ktor-client-core/js/src/io/ktor/client/engine/js/compatibility/Utils.kt:19)
when running tests on the js/node target, after moving from kotlin 1.9.21 to 2.0.0.
• The error does not occur when running on the js/browser target.
• The error didn't exist on kotlin 1.9.21
• I'm targeting ES modules (useEsModules()
)e5l
06/17/2024, 9:53 AMFelix
06/17/2024, 10:58 AMFelix
06/17/2024, 11:08 AMrequire
function is not available in the module scope.