Rohde Fischer
01/05/2025, 12:33 PMprocess
from nodejs? It seems that my kotlinjs in general is very browser-centric, which is kind of frustrating πRobert Jaros
01/05/2025, 12:42 PMRohde Fischer
01/05/2025, 12:55 PMRobert Jaros
01/05/2025, 12:56 PMRohde Fischer
01/05/2025, 12:57 PMRohde Fischer
01/05/2025, 1:09 PMWhen accessing module declarations from UMD, they must be marked with both @JsModule and @JsNonModule.
Chrimaeon
01/05/2025, 1:28 PMmultiplatform
plugin?Robert Jaros
01/05/2025, 1:38 PMuseEsModules()
optionRohde Fischer
01/05/2025, 1:57 PMRohde Fischer
01/05/2025, 1:58 PMRohde Fischer
01/05/2025, 2:00 PMRohde Fischer
01/05/2025, 2:10 PMError: Cannot find module '/home/rohdef/git/action-build-container-source/build/js/node_modules/@docker/actions-toolkit/lib/github' imported from /home/rohdef/git/action-build-container-source/build/js/packages/action-build-container/kotlin/action-build-container.mjs
Did you mean to import "@docker/actions-toolkit/lib/github.js"?
the error I get on the existing imports are like this one. I guess it could change it to refer to the .js
files, but isn't that kind of wrong to do?Rohde Fischer
01/05/2025, 2:21 PMError [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/_actions/rohdef/action-build-container/main/node_modules/action-build-container/kotlin/action-build-container.mjs not supported.
Instead change the require of /home/runner/work/_actions/rohdef/action-build-container/main/node_modules/action-build-container/kotlin/action-build-container.mjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/home/runner/work/_actions/rohdef/action-build-container/main/index.js:5:1) {
code: 'ERR_REQUIRE_ESM'
}
it is not happy with meRobert Jaros
01/05/2025, 2:28 PMRohde Fischer
01/05/2025, 2:29 PMChrimaeon
01/05/2025, 2:55 PMnodeJs
and not browser
?Edoardo Luppi
01/05/2025, 3:46 PMuseCommonJs()
or useEsModules()
Edoardo Luppi
01/05/2025, 3:47 PMRobert Jaros
01/05/2025, 3:49 PMuseCommonJs()
(it should allow require
, shouldn't it?)Edoardo Luppi
01/05/2025, 3:51 PMturansky
01/05/2025, 5:04 PMI really thought kotlin-node project will just work for you.@Robert Jaros we had no control under project dependencies π.
kotlin-node
support both ESM and CommonJS.
ESM - default recommendation, because it works everywhere (Browser, Node, Deno) and it's future default/single Kotlin/JS option.
CommonJS - can be used if you have problems with dependencies.
Node 23.5.0
already contains pills for mixed projects.
AFAIK @Vampire has pills for CommonJS dependencies in ESM project πturansky
01/05/2025, 5:06 PMVampire
01/05/2025, 5:34 PMVampire
01/05/2025, 5:35 PMRohde Fischer
01/06/2025, 8:08 AMRohde Fischer
01/06/2025, 8:10 AMRohde Fischer
01/06/2025, 8:14 AMuseCommonJs
, but in actuality useESModules
would be better, if I can figure out to rework that wrappers I already have?Rohde Fischer
01/06/2025, 8:19 AMuseCommonJs
-approach works πVampire
01/06/2025, 12:23 PMEdoardo Luppi
01/06/2025, 12:26 PMEdoardo Luppi
01/06/2025, 12:26 PMEdoardo Luppi
01/06/2025, 12:29 PM