Copilot commented on code in PR #19815:
URL: https://github.com/apache/druid/pull/19815#discussion_r3686695997
##########
web-console/webpack.config.mjs:
##########
@@ -58,7 +58,7 @@ export default env => {
const plugins = [
new webpack.DefinePlugin({
'process.env': JSON.stringify({ NODE_ENV: mode }),
- 'global': {},
+ 'global': 'globalThis.global',
'NODE_ENV': JSON.stringify(mode),
Review Comment:
`DefinePlugin` sets `global` to `globalThis.global`, but in browsers
`globalThis.global` is typically `undefined`. Any bundled code that does
property access like `global.Buffer` / `global.process` / `global.ace` would
become `globalThis.global.<prop>` and can throw at runtime. Defining `global`
as `globalThis` avoids the extra indirection and ensures it always points at
the real global object in both browser and Node/Jest.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]