opentiny / tiny-engine

TinyEngine is a low-code engine based on which you can build or develop low-code platforms in different domains/TinyEngine是一个低代码引擎,基于这个引擎可以构建或者开发出不同领域的低代码平台
https://opentiny.design/tiny-engine
MIT License
1.96k stars 302 forks source link

🐛 [Bug]: 发布应用到git仓库后生成的代码无法构建 #351

Open UriChen opened 8 months ago

UriChen commented 8 months ago

Environment

Chrome 版本 122.0.6261.129(正式版本) (64 位)

Version

v16.20.2

Version

@opentiny/vue@3.10.0

Link to minimal reproduction

只能提供报错vue组件的信息

Step to reproduce

在编辑器中预览是正常的,但是发布应用后在本地构建时发现了以下问题

  1. 页面使用了img组件,但是生成的代码里import了'undefined'
  2. 'element-plus'依赖不在package.json中
  3. '@opentiny/tiny-engine-builtin-component'依赖不在package.json中
<script setup>
import * as vue from 'vue'
import { defineProps, defineEmits } from 'vue'
import { I18nInjectionKey } from 'vue-i18n'
import { Img } from 'undefined'
import { Button as TinyButton } from '@opentiny/vue'
import { ElInput } from 'element-plus'
import { CanvasRow, CanvasCol, CanvasRowColContainer } from '@opentiny/tiny-engine-builtin-component'

另外控制台报错如下

X [ERROR] No matching export in "node_modules/.pnpm/vue-demi@0.14.7_vue@3.2.25/node_modules/vue-demi/lib/index.mjs" for import "hasInjectionContext"

node_modules/.pnpm/pinia@2.1.7_vue@3.2.25/node_modules/pinia/dist/pinia.mjs:6:9:
  6 │ import { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isVue2, isRef, isReactive, set, getCurrentScope, onScopeDis... 
    ╵          ~~~~~~~~~~~~~~~~~~~

20:54:03 [vite] error while updating dependencies: Error: Build failed with 1 error: node_modules/.pnpm/pinia@2.1.7_vue@3.2.25/node_modules/pinia/dist/pinia.mjs:6:9: ERROR: No matching export in "node_modules/.pnpm/vue-demi@0.14.7_vue@3.2.25/node_modules/vue-demi/lib/index.mjs" for import "hasInjectionContext" at failureErrorWithLog (D:\tools\tiny-lowcode\artify-app-repo\node_modules.pnpm\esbuild@0.14.54\node_modules\esbuild\lib\main.js:1624:15) at D:\tools\tiny-lowcode\artify-app-repo\node_modules.pnpm\esbuild@0.14.54\node_modules\esbuild\lib\main.js:1266:28 at runOnEndCallbacks (D:\tools\tiny-lowcode\artify-app-repo\node_modules.pnpm\esbuild@0.14.54\node_modules\esbuild\lib\main.js:1046:63) at buildResponseToResult (D:\tools\tiny-lowcode\artify-app-repo\node_modules.pnpm\esbuild@0.14.54\node_modules\esbuild\lib\main.js:1264:7) at D:\tools\tiny-lowcode\artify-app-repo\node_modules.pnpm\esbuild@0.14.54\node_modules\esbuild\lib\main.js:1377:14 at D:\tools\tiny-lowcode\artify-app-repo\node_modules.pnpm\esbuild@0.14.54\node_modules\esbuild\lib\main.js:678:9 at handleIncomingPacket (D:\tools\tiny-lowcode\artify-app-repo\node_modules.pnpm\esbuild@0.14.54\node_modules\esbuild\lib\main.js:775:9) at Socket.readFromStdout (D:\tools\tiny-lowcode\artify-app-repo\node_modules.pnpm\esbuild@0.14.54\node_modules\esbuild\lib\main.js:644:7) at Socket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:315:12) Vite Error, /node_modules/.vite/deps/vue.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/vue-router.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/vue-i18n.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/@opentiny_tiny-engine-i18n-host.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/vue.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/axios.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/pinia.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/pinia.js?v=263ff0ba optimized info should be defined (x2) Vite Error, /node_modules/.vite/deps/pinia.js?v=263ff0ba optimized info should be defined (x3) Vite Error, /node_modules/.vite/deps/pinia.js?v=263ff0ba optimized info should be defined (x4) Vite Error, /node_modules/.vite/deps/vue.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/vue-router.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/axios-mock-adapter.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/pinia.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/vue-i18n.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/vue.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/vue-router.js?v=7169e8a0 optimized info should be defined Vite Error, /node_modules/.vite/deps/vue.js?v=e6a33a09 optimized info should be defined Vite Error, /node_modules/.vite/deps/pinia.js?v=34fb8f92 optimized info should be defined Vite Error, /node_modules/.vite/deps/vue-i18n.js?v=5e1e1c17 optimized info should be defined Vite Error, /node_modules/.vite/deps/vue.js?v=e6a33a09 optimized info should be defined Vite Error, /node_modules/.vite/deps/vue.js?v=e6a33a09 optimized info should be defined (x2) Vite Error, /node_modules/.vite/deps/@opentiny_tiny-engine-i18n-host.js?v=bfdf6d8c optimized info should be defined Vite Error, /node_modules/.vite/deps/vue.js?v=e6a33a09 optimized info should be defined Vite Error, /node_modules/.vite/deps/vue-router.js?v=7169e8a0 optimized info should be defined Vite Error, /node_modules/.vite/deps/vue-i18n.js?v=5e1e1c17 optimized info should be defined Vite Error, /node_modules/.vite/deps/axios.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/axios-mock-adapter.js?v=263ff0ba optimized info should be defined Vite Error, /node_modules/.vite/deps/pinia.js?v=34fb8f92 optimized info should be defined Vite Error, /node_modules/.vite/deps/pinia.js?v=34fb8f92 optimized info should be defined (x2) Vite Error, /node_modules/.vite/deps/pinia.js?v=34fb8f92 optimized info should be defined (x3) Vite Error, /node_modules/.vite/deps/pinia.js?v=34fb8f92 optimized info should be defined (x4)

What is expected

No response

What is actually happening

No response

Any additional comments (optional)

No response

Issues-translate-bot commented 8 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: The code generated after publishing the application to the git repository cannot be built

chilingling commented 5 months ago

@UriChen 可以使用新版出码重新试试(在 develop 分支可测试)。

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


@UriChen You can try again using the new version of the code (testable in the develop branch).