Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

正常步骤安装vue3的默认模版,编译后weapp报错 #71

Closed
lianxin255 opened this issue Jan 7, 2021 · 3 comments
Closed

正常步骤安装vue3的默认模版,编译后weapp报错 #71

lianxin255 opened this issue Jan 7, 2021 · 3 comments

Comments

@lianxin255
Copy link

问题描述

正常步骤安装vue3的默认模版,编译后weapp报错

版本信息

v1.0.0-alpha.17

涉及的平台

weapp

错误信息

VM209 WAService.js:2 ReferenceError: Element is not defined
    at Object.app.mount (runtime-dom.esm-bundler.js:1221)
    at EA.value (vue3.ts:162)
    at EA.<anonymous> (VM209 WAService.js:2)
    at new EA (VM209 WAService.js:2)
    at Function.<anonymous> (VM209 WAService.js:2)
    at VM209 WAService.js:2
    at Module../src/app.ts (app.ts?c593:8)
    at __webpack_require__ (bootstrap:79)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
VM209 WAService.js:2 TypeError: Cannot read property '$forceUpdate' of undefined
    at Object.updateAppInstance (vue3.ts:143)
    at Object.mount (vue3.ts:134)
    at mount (common.ts:119)
    at ge.onLoad (common.ts:133)
    at ge.<anonymous> (VM209 WAService.js:2)
    at ge.c.__callPageLifeTime__ (VM209 WAService.js:2)
    at Ge (VM209 WAService.js:2)
    at Te (VM209 WAService.js:2)
    at Function.<anonymous> (VM209 WAService.js:2)
    at i.<anonymous> (VM209 WAService.js:2)

代码

// code here
@b2nil
Copy link
Owner

b2nil commented Jan 7, 2021

@1933467270

这是 @vue/runtime-dom 最近的一次变更 fix(runtime-dom): support mounting app on ShadowRoot 导致 Taro 运行时 @tarojs/runtime 报错,详情在这里:[Bug Report]Vue3 适配的 bug

Taro 官方已经修复该问题,但还没发布新的版本。暂时可以把 Vue 3.0 的版本降到 v3.0.4

@abearxiong
Copy link

image

这个吧,
node_modules/@tarojs/mini-runner/dist/webpack/build.conf.js

104行,

vue降下去是一样的

@b2nil
Copy link
Owner

b2nil commented Jan 8, 2021

当然,按照上面所说改 @tarojs/mini-runner 也行。

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

No branches or pull requests

3 participants