amis vite 加载thirds/monaco-editor 找不到包

7bsow1i6  于 7个月前  发布在  其他
关注(0)|答案(2)|浏览(82)
描述问题:

在vue3 + vite + amis 使用 editor代码编辑器,第三方包报错,但神奇在使用js方式依赖又没问题。

截图或视频:

如何复现(请务必完整填写下面内容):
  1. 你是如何使用 amis 的?
    在vue3 中使用amis相关版本如下;
    "amis": "^6.5.0",
    "vue": "^3.2.45",
    "vite": "5.3.1",

main.js 依赖如下:
// 引入amis
import "@fortawesome/fontawesome-free/css/all.css"
import "@fortawesome/fontawesome-free/css/v4-shims.css"
import 'amis/sdk/sdk.js';
import 'amis/lib/themes/antd.css';
import 'amis/sdk/helper.css';
import 'amis/sdk/iconfont.css';
import 'amis/sdk/json-view.js';
import 'amis/sdk/exceljs.js';
import 'amis/sdk/charts.js';

  1. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    "amis": "^6.5.0", 当前最新版本问题依然存在
  2. 粘贴有问题的完整 amis schema 代码:
{
  "type": "page",
  "title": false,
  "body": [
    {
      "type": "form",
      "id": "id-form",
      "name": "form",
      "title": "表单",
      "mode": "horizontal",
      "body": [
        {
          "type": "editor",
          "name": "scriptStr",
          "label": "脚本",
          "language": "javascript",
          "id": "u:9bbff25885df"
        }
      ],
      "actions": [],
      "resetAfterSubmit": false,
      "wrapWithPanel": false,
      "debug": true,
      "affixFooter": false,
      "submitOnChange": false,
      "feat": "Insert"
    }
  ],
  "id": "id-page",
  "name": "page",
  "asideResizor": false,
  "pullRefresh": {
    "disabled": true
  },
  "regions": [
    "body",
    "header"
  ]
}
  1. 操作步骤

刷新页面,查看network出现404错误,代码编辑器点击无反应。

d6kp6zgx

d6kp6zgx1#

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

oprakyz7

oprakyz72#

我也是vite报错 ,你用js是怎么解决的

相关问题