Reuben Firmin
07/25/2024, 11:53 AMindex.mjs:2615 Uncaught ReferenceError: process is not defined
at ../../node_modules/@whereby.com/media/dist/index.mjs (index.mjs:2615:1)
at __webpack_require__ (bootstrap:24:1)
Reuben Firmin
07/25/2024, 11:53 AMconst server = rtcStatsConnection(process.env.RTCSTATS_URL || "<wss://rtcstats.srv.whereby.com>");
I tried adding https://www.npmjs.com/package/process and:
external fun require(mod: String): dynamic
@OptIn(ExperimentalJsExport::class)
@JsExport
fun main() {
require("process")
}
...but this doesn't fix it. (I realize that it only adds process.browser, but I still get "process is undefined")turansky
07/25/2024, 12:22 PMDefinePlugin
for webpackturansky
07/25/2024, 12:27 PMkfc-plugins
Reuben Firmin
07/25/2024, 12:40 PMconst webpack = require('webpack');
config.plugins.push(
new webpack.DefinePlugin({
'process': JSON.stringify({
env: {
RTCSTATS_URL: '<wss://rtcstats.srv.whereby.com>'
}
}),
'process.env': JSON.stringify({
RTCSTATS_URL: '<wss://rtcstats.srv.whereby.com>'
}),
'process.env.RTCSTATS_URL': JSON.stringify('<wss://rtcstats.srv.whereby.com>')
})
);
turansky
07/25/2024, 12:52 PMReuben Firmin
07/25/2024, 1:04 PMturansky
07/25/2024, 2:00 PM'process.env.RTCSTATS_URL': JSON.stringify('<wss://rtcstats.srv.whereby.com>')
})
this replacement - probably single requiredReuben Firmin
07/25/2024, 2:33 PM