baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
16.48k stars 2.41k forks source link

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

Open DreamingLight opened 2 weeks ago

DreamingLight commented 2 weeks ago

描述问题:

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

截图或视频:

image

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

  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"
    ]
    }
  3. 操作步骤

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

github-actions[bot] commented 2 weeks ago

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

Please review the labels and make any necessary changes.

cutestyxy commented 1 week ago

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