DTStack / DTStack/monaco-sql-languages
报错 Uncaught Error: [createInstance] N depends on UNKNOWN service treeViewsDndService.
- Dominant language
- TypeScript
- Stars
- 295
- Forks
- 50
- Avg merge
- 1h 21m
- Merged PRs (30d)
- 1
Description
## 问题
应用层进行以下操作报错(包括但不仅限于):
- 不同编辑器切换
- 打开一个新的编辑器
- 点击自定义的右键菜单
## 报错信息
`Uncaught Error: [createInstance] N depends on UNKNOWN service treeViewsDndService.
Error: [createInstance] N depends on UNKNOWN service treeViewsDndService.
at g._throwIfStrict (34624.54f3c2ebae0fa0172889.js:1:12559)
at g._createInstance (34624.54f3c2ebae0fa0172889.js:1:8878)
at g.createInstance (34624.54f3c2ebae0fa0172889.js:1:8667)
at f._instantiateById (79216.7bcdc210d90bec076060.js:1:21952)
at f._instantiateSome (79216.7bcdc210d90bec076060.js:1:21562)
at 79216.7bcdc210d90bec076060.js:1:20786
at g._throwIfStrict (34624.54f3c2ebae0fa0172889.js:1:12559)
at g._createInstance (34624.54f3c2ebae0fa0172889.js:1:8878)
at g.createInstance (34624.54f3c2ebae0fa0172889.js:1:8667)
at f._instantiateById (79216.7bcdc210d90bec076060.js:1:21952)
at f._instantiateSome (79216.7bcdc210d90bec076060.js:1:21562)
at 79216.7bcdc210d90bec076060.js:1:20786
at 34928.208a93e8d793d25272b0.js:1:14036`
内置json报错
```
34009.44c689272f43f9f349ca.js:2 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'schemas')
at Object.configure (json.worker.js:2:837561)
at new (json.worker.js:2:839387)
at Ke._foreignModuleFactory (json.worker.js:2:838777)
at Ke.$loadForeignModule (json.worker.js:2:341251)
at L._handleMessage (json.worker.js:2:198986)
at Object.handleMessage (json.worker.js:2:198507)
at v._handleRequestMessage (json.worker.js:2:195400)
at v._handleMessage (json.worker.js:2:194841)
at v.handleMessage (json.worker.js:2:194413)
at L.onmessage (json.worker.js:2:198605)
```
## 原因分析
从报错可以看出,是`monaco-editor` 在版本 0.52.2 中缺少 `treeViewsDndService` 服务依赖导致的。而这类服务只存在于 VS Code workbench 环境,不属于 Monaco standalone 环境。
## 解法
目前将找到的方法都进行了尝试,暂时还没办法解决。
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the error in the application-layer operations listed in the issue with monaco-editor 0.52.2, then inspect the integration around the missing treeViewsDndService dependency and the JSON worker error. Done means editor switching, opening editors, and custom context menus no longer produce these errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100