microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.97k stars 29.19k forks source link

VS Code 1.88 doesn't support ESM extensions #209560

Closed AlexCannonball closed 6 months ago

AlexCannonball commented 7 months ago

Type: Bug

  1. Make an extension code to use ESM instead of CJS. Set "type": "module" in the extension's package.json file.
  2. Launch this extension via VS Code "Run and Debug".
  3. Get an error upon the extension activation:

    Activating extension 'xxxxxx' failed: require() of ES Module d:\xxxxxx\out\extension.js from d:\Programs\VS_code\resources\app\out\vs\loader.js not supported. Instead change the require of extension.js in d:\Programs\VS_code\resources\app\out\vs\loader.js to a dynamic import() which is available in all CommonJS modules..

VS Code version: Code 1.88.0 (5c3e652f63e798a5ac2f31ffd0d863669328dc4c, 2024-04-03T13:26:18.741Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 5700U with Radeon Graphics (16 x 1797)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|14.82GB (7.62GB free)| |Process Argv|--log info --log plex.vscode-protolint=trace --crash-reporter-id 1760485e-64d5-4472-924c-6ff6ba32397c| |Screen Reader|no| |VM|0%|
Extensions (10) Extension|Author (truncated)|Version ---|---|--- swagger-viewer|Arj|3.1.2 vscode-eslint|dba|2.4.4 gitlens|eam|14.9.0 EditorConfig|Edi|0.16.4 prettier-vscode|esb|10.4.0 plantuml|jeb|2.18.0 remote-wsl|ms-|0.88.0 vscode-yaml|red|1.14.0 code-spell-checker|str|3.0.1 vscode-proto3|zxh|0.5.5
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 d34g3935:30971562 fegfb526:30981948 bg6jg535:30979843 ccp2r6:30993542 dsvsc020:30976470 pythonait:31006305 gee8j676:31009558 dsvsc021:30996838 g1icg217:30999571 ```
starball5 commented 7 months ago

https://github.com/microsoft/vscode-loader/issues/36 ?

thernstig commented 7 months ago

@AlexCannonball Duplicate of https://github.com/microsoft/vscode/issues/130367