Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite项目展示amis的diff-editor组件时,不会显示差异样式 #11375

Open
zbl400 opened this issue Dec 16, 2024 · 1 comment
Open

vite项目展示amis的diff-editor组件时,不会显示差异样式 #11375

zbl400 opened this issue Dec 16, 2024 · 1 comment

Comments

@zbl400
Copy link

zbl400 commented Dec 16, 2024

描述问题:

使用vite创建的项目,用到diff-editor组件,但是不会显示差异样式

截图或视频:

image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    利用 vite, npm 使用 amis
    vite配置中已经使用默认 vite-plugin-monaco-editor 配置。

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    6.10.0, 已经是最新

  3. 粘贴有问题的完整 amis schema 代码:

{
    "type": "page",
    "title": "aaa",
    "body": [
      {
        "type": "diff-editor",
        "label": "diff编辑器",
        "name": "diff",
        "id": "u:3d3004153260",
        "language": "javascript",
        "diffValue": "aa",
        "value": "bb"
      }
    ],
    "id": "u:4de9f83dc95f",
    "asideResizor": false,
    "pullRefresh": {
      "disabled": true
    }
  }
  1. 操作步骤
    参见(https://codesandbox.io/p/devbox/vite-amis-diff-editor-crhzzd)
@lanyuanxiaoyao
Copy link

lanyuanxiaoyao commented Dec 22, 2024

我在使用sdk模式的时候也遇到了同样的情况,并且options也没有响应,似乎是与monaco editor有关,控制台报错

Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:63342/bookstore/bookstore.main/static/sdk/thirds/monaco-editor/min/vs/base/worker/workerMain.js' failed to load.
    at data:text/javascript;charset=utf-8,%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20self.MonacoEnvironment%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20baseUrl%3A%20'http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20paths%3A%20%7B%22vs%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%22%2C%22vs%2Fbase%2Fworker%2FworkerMain%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbase%2Fworker%2FworkerMain%22%2C%22vs%2Fbasic-languages%2Fapex%2Fapex%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fapex%2Fapex%22%2C%22vs%2Fbasic-languages%2Fazcli%2Fazcli%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fazcli%2Fazcli%22%2C%22vs%2Fbasic-languages%2Fclojure%2Fclojure%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fclojure%2Fclojure%22%2C%22vs%2Fbasic-languages%2Fbat%2Fbat%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fbat%2Fbat%22%2C%22vs%2Fbasic-languages%2Fcoffee%2Fcoffee%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fcoffee%2Fcoffee%22%2C%22vs%2Fbasic-languages%2Fcpp%2Fcpp%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fcpp%2Fcpp%22%2C%22vs%2Fbasic-languages%2Fcsharp%2Fcsharp%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fcsharp%2Fcsharp%22%2C%22vs%2Fbasic-languages%2Fcss%2Fcss%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fcss%2Fcss%22%2C%22vs%2Fbasic-languages%2Fdockerfile%2Fdockerfile%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fdockerfile%2Fdockerfile%22%2C%22vs%2Fbasic-languages%2Ffsharp%2Ffsharp%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Ffsharp%2Ffsharp%22%2C%22vs%2Fbasic-languages%2Fgo%2Fgo%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fgo%2Fgo%22%2C%22vs%2Fbasic-languages%2Fhandlebars%2Fhandlebars%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fhandlebars%2Fhandlebars%22%2C%22vs%2Fbasic-languages%2Fhtml%2Fhtml%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fhtml%2Fhtml%22%2C%22vs%2Fbasic-languages%2Fini%2Fini%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fini%2Fini%22%2C%22vs%2Fbasic-languages%2Fjava%2Fjava%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fjava%2Fjava%22%2C%22vs%2Fbasic-languages%2Fjavascript%2Fjavascript%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fjavascript%2Fjavascript%22%2C%22vs%2Fbasic-languages%2Fless%2Fless%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fless%2Fless%22%2C%22vs%2Fbasic-languages%2Flua%2Flua%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Flua%2Flua%22%2C%22vs%2Fbasic-languages%2Fmarkdown%2Fmarkdown%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fmarkdown%2Fmarkdown%22%2C%22vs%2Fbasic-languages%2Fmsdax%2Fmsdax%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fmsdax%2Fmsdax%22%2C%22vs%2Fbasic-languages%2Fobjective-c%2Fobjective-c%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fobjective-c%2Fobjective-c%22%2C%22vs%2Fbasic-languages%2Fphp%2Fphp%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fphp%2Fphp%22%2C%22vs%2Fbasic-languages%2Fpostiats%2Fpostiats%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fpostiats%2Fpostiats%22%2C%22vs%2Fbasic-languages%2Fpowershell%2Fpowershell%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fpowershell%2Fpowershell%22%2C%22vs%2Fbasic-languages%2Fpug%2Fpug%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fpug%2Fpug%22%2C%22vs%2Fbasic-languages%2Fpython%2Fpython%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fpython%2Fpython%22%2C%22vs%2Fbasic-languages%2Fr%2Fr%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fr%2Fr%22%2C%22vs%2Fbasic-languages%2Frazor%2Frazor%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Frazor%2Frazor%22%2C%22vs%2Fbasic-languages%2Fredis%2Fredis%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fredis%2Fredis%22%2C%22vs%2Fbasic-languages%2Fredshift%2Fredshift%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fredshift%2Fredshift%22%2C%22vs%2Fbasic-languages%2Fruby%2Fruby%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fruby%2Fruby%22%2C%22vs%2Fbasic-languages%2Frust%2Frust%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Frust%2Frust%22%2C%22vs%2Fbasic-languages%2Fsb%2Fsb%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fsb%2Fsb%22%2C%22vs%2Fbasic-languages%2Fscheme%2Fscheme%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fscheme%2Fscheme%22%2C%22vs%2Fbasic-languages%2Fscss%2Fscss%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fscss%2Fscss%22%2C%22vs%2Fbasic-languages%2Fshell%2Fshell%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fshell%2Fshell%22%2C%22vs%2Fbasic-languages%2Fsolidity%2Fsolidity%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fsolidity%2Fsolidity%22%2C%22vs%2Fbasic-languages%2Fsql%2Fsql%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fsql%2Fsql%22%2C%22vs%2Fbasic-languages%2Fst%2Fst%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fst%2Fst%22%2C%22vs%2Fbasic-languages%2Fswift%2Fswift%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fswift%2Fswift%22%2C%22vs%2Fbasic-languages%2Ftypescript%2Ftypescript%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Ftypescript%2Ftypescript%22%2C%22vs%2Fbasic-languages%2Fvb%2Fvb%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fvb%2Fvb%22%2C%22vs%2Fbasic-languages%2Fxml%2Fxml%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fxml%2Fxml%22%2C%22vs%2Fbasic-languages%2Fyaml%2Fyaml%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbasic-languages%2Fyaml%2Fyaml%22%2C%22vs%2Feditor%2Feditor.main%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Feditor%2Feditor.main%22%2C%22vs%2Feditor%2Feditor.main.css%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Feditor%2Feditor.main.css%22%2C%22vs%2Feditor%2Feditor.main.nls%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Feditor%2Feditor.main.nls%22%2C%22vs%2Feditor%2Feditor.main.nls.zh-cn%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Feditor%2Feditor.main.nls.zh-cn%22%2C%22vs%2Fbase%2Fbrowser%2Fui%2Fcodicons%2Fcodicon%2Fcodicon.ttf%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbase%2Fbrowser%2Fui%2Fcodicons%2Fcodicon%2Fcodicon.ttf%22%2C%22vs%2Flanguage%2Ftypescript%2FtsMode%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Flanguage%2Ftypescript%2FtsMode%22%2C%22vs%2Flanguage%2Ftypescript%2FtsWorker%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Flanguage%2Ftypescript%2FtsWorker%22%2C%22vs%2Flanguage%2Fjson%2FjsonMode%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Flanguage%2Fjson%2FjsonMode%22%2C%22vs%2Flanguage%2Fjson%2FjsonWorker%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Flanguage%2Fjson%2FjsonWorker%22%2C%22vs%2Flanguage%2Fhtml%2FhtmlMode%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Flanguage%2Fhtml%2FhtmlMode%22%2C%22vs%2Flanguage%2Fhtml%2FhtmlWorker%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Flanguage%2Fhtml%2FhtmlWorker%22%2C%22vs%2Flanguage%2Fcss%2FcssMode%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Flanguage%2Fcss%2FcssMode%22%2C%22vs%2Flanguage%2Fcss%2FcssWorker%22%3A%22http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Flanguage%2Fcss%2FcssWorker%22%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20importScripts('http%3A%2F%2Flocalhost%3A63342%2Fbookstore%2Fbookstore.main%2Fstatic%2Fsdk%2Fthirds%2Fmonaco-editor%2Fmin%2Fvs%2Fbase%2Fworker%2FworkerMain.js')%3B:6:15

似乎与这个错误有关 microsoft/monaco-editor#4675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants