shd101wyy / vscode-markdown-preview-enhanced

One of the "BEST" markdown preview extensions for Visual Studio Code
https://shd101wyy.github.io/markdown-preview-enhanced
Other
1.45k stars 172 forks source link

[BUG] vscode-markdown-preview-enhanced 0.8.x is incompatible with vscode 1.81.x #1813

Closed cobolbaby closed 11 months ago

cobolbaby commented 11 months ago

Describe the bug No response when clicking Markdown Preview Enhanced:open preview to side in the menu bar.

Environment

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

shd101wyy commented 11 months ago

I actually don't know why this happened. I am using 1.82.0. Can you try upgrading your vscode?

cobolbaby commented 11 months ago

Vscode no longer supports ubuntu 16.04 starting from version 1.82.x.

Ref: https://github.com/microsoft/vscode/issues/193086

GrainRainy commented 11 months ago

i have the same question.

shd101wyy commented 11 months ago

I just released 0.8.3. I am not sure if this helps. I reduced the requirement of VSCode to 1.78.0. Before, it was 1.80.0

cobolbaby commented 11 months ago

It's a pity that it doesn't solve the problem either.

APJifengc commented 11 months ago

In DevTools it shows that:

Activating extension 'shd101wyy.markdown-preview-enhanced' failed: structuredClone is not defined

It seems that structuredClone was added in Node 17, while VSCode's Node version is 16.17.1, so it doesn't work.

shd101wyy commented 11 months ago

Okay let me try downgrade node.js version.

shd101wyy commented 11 months ago

The problem with node16 is that its LTS already ended.
May I ask why you guys don't just upgrade your vscode?

cobolbaby commented 11 months ago

While we do have an upgrade plan in place, we need to coordinate a suitable timeframe due to the number of machines requiring upgrades and our recent workload.

shd101wyy commented 11 months ago

我看了下。我应该是无法 downgrade 到 nodejs 16 :joy: ,因为现在的一些依赖需要 nodejs 18。只能说你们自己升级到 1.82.0 了。

感觉唯一能做的就是 hack 一下:https://stackoverflow.com/questions/73607410/referenceerror-structuredclone-is-not-defined-using-jest-with-nodejs-typesc 但是貌似这个方法不大推荐。

或者是 locate 一下是哪里 call 了这个 structuredClone 函数。

shd101wyy commented 11 months ago

我周六争取放一个版本支持 1.70.0。应该会写好了

shd101wyy commented 11 months ago

Okay 0.8.6 should fix this issue now. Thanks

cobolbaby commented 11 months ago

感谢,已经验证通过.

不过我没太看明白新版为什么会出现这个问题,以及怎么解决的,能否解解惑?

shd101wyy commented 11 months ago

vega-lite 这个依赖的问题,里面使用了 structuredClone,但是 vscode 1.82.0 以下版本使用的 node.js 16 不支持 structuredClone。 所以我添加了 structuredClone 的 polyfill,然后修改了一下 vega-lite 的代码。这样就没问题了。