Luca
02/08/2024, 6:59 PMprocess is not defined
on both js and wasmJs targets so I added:
// webpack.config.d/plugins.ks
const webpack = require('webpack');
config.plugins.push(
new webpack.ProvidePlugin({
process: require.resolve('process/browser'),
}),
);
That fixes the js target.
But now for wasmJs I get TypeError: process.release is undefined
Is this expected?Luca
02/08/2024, 7:01 PMconst webpack = require('webpack');
config.plugins.push(
new webpack.ProvidePlugin({
process: require.resolve('process/browser'),
'process.release': {name: "browser"},
}),
);
That seems to resolve that, but I get a pretty obscure error:
ERROR
specifier.charCodeAt is not a function
ERROR in ./kotlin/secretk-kamel-samples-wasm-js.uninstantiated.mjs
Cannot read properties of undefined (reading 'module')
Robert Jaros
02/08/2024, 7:35 PMprocess
polyfill for browser?Robert Jaros
02/08/2024, 7:40 PMLuca
02/08/2024, 7:42 PMLuca
02/08/2024, 7:43 PMEdoardo Luppi
02/08/2024, 8:54 PMconst isNodeJs =
(typeof process !== 'undefined'
&& process.versions != null
&& process.versions.node != null) ||
(typeof window !== 'undefined'
&& typeof window.process !== 'undefined'
&& window.process.versions != null
&& window.process.versions.node != null);
Luca
02/08/2024, 8:57 PMEdoardo Luppi
02/08/2024, 8:58 PMEdoardo Luppi
02/08/2024, 9:02 PMprocess is not defined
come from the same place, or from where?Luca
02/08/2024, 9:04 PMprocess.release
check to fail in the kotlin generated codeEdoardo Luppi
02/08/2024, 9:43 PMprocess
, so I'd say the problem in the K/JS side is expected. You need to understand why your first dependency wants a process object.Luca
02/08/2024, 9:44 PMEdoardo Luppi
02/08/2024, 9:44 PMLuca
02/08/2024, 9:45 PMLuca
02/08/2024, 9:47 PMEdoardo Luppi
02/08/2024, 9:48 PMLuca
02/08/2024, 9:49 PMLuca
02/08/2024, 9:50 PMLuca
02/08/2024, 9:51 PM