[Bug] Platform is not always well detected
Reproducible in vscode.dev or in VS Code Desktop?
- [X] Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- [ ] Not reproducible in the monaco editor playground
Monaco Editor Playground Link
No response
Monaco Editor Playground Code
No response
Reproduction Steps
No response
Actual (Problematic) Behavior
No response
Expected Behavior
No response
Additional Context
Since https://github.com/microsoft/vscode/pull/200935, process existing takes priority over navigator to detect is it run inside a browser. The issue is that with some bundlers like webpack, it is sometimes required to polyfill node internal (like process).
It now has as consequence to wrongly be detected as a native platform which can have consequences, for instance:
- https://github.com/microsoft/vscode/blob/31a7befa311836b14adc6348293ad22f2257998a/src/vs/editor/browser/viewParts/lines/viewLine.ts#L23
- https://github.com/microsoft/vscode/blob/31a7befa311836b14adc6348293ad22f2257998a/src/vs/editor/contrib/clipboard/browser/clipboard.ts#L233
- and many more
I've got the exact same issue, so I can't upgrade to 0.46. I used process as a fallback in my webpack.config.js and can't remove it. So my platform is not well detected.
- With
0.45it wasweb/macOs, [CORRECT] - With
0.46it isnative/linux. [WRONG]
Indeed process.env is heavily used in A LOT of web-apps, likely the majority of them.
The entire JS ecosystem is built on top of old libraries that appeared at the beginning of Node, and which require process.env to exist. Therefore web-apps which use such dependencies in the browser need to polyfill process.env.
The change in 0.46 breaks the Internet!
I closed issue #4387 which I think is related to this one. For me, the problem exhibits itself in that the CtrlCmd key code does not work as it did in 0.45.0.
Oof, same issue here. No one has a workaround yet?
Same issue here. All my keyboard shortcuts are working incorrectly on mac/chrome. Is there a workaround to manually set the platform?
After upgrading to 0.48.0 it works properly for me.