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

使用自定义组件,控制台很多Failed to resolve component的警告 #16607

Open
ffhope opened this issue Sep 27, 2024 · 0 comments
Open

Comments

@ffhope
Copy link

ffhope commented Sep 27, 2024

相关平台

微信小程序

小程序基础库: 3.5.8
使用框架: Vue 3

复现步骤

在index.config.ts里配置export default {
navigationStyle: 'custom',
enableShareAppMessage: true,
navigationBarTitleText: ' ',
transparentTitle: 'always',
titlePenetrate: 'YES',
navigationBarTextStyle: 'white',
backgroundColor: '#ffffff',
enablePullDownRefresh: false,
disableScroll: true,
usingComponents: {
'debug-tool': '../../scopeComponent/DebugTool',
},
componentPlaceholder: {
'debug-tool': 'View',
},
};

会导致微信小程序有警告[Vue warn]: Failed to resolve component: debug-tool
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.

按照官网教程配置
[
'@tarojs/plugin-framework-vue3',
{
vueLoaderOption: {
compilerOptions: {
isCustomElement: (tag) => tag.includes('debug'),
whitespace: 'preserve',
},
reactivityTransform: true, // 开启vue3响应性语法糖
},
},
],
依然有警告

期望结果

控制台没有[Vue warn]: Failed to resolve component的警告

实际结果

所有用usingComponents配置的这种的组件全部都报了警告

环境信息

Taro CLI 4.0.5 environment info:
    System:
      OS: macOS 14.2
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 16.20.2 - /usr/local/bin/node
      Yarn: 1.22.22 - /usr/local/bin/yarn
      npm: 8.19.4 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.32 => 3.6.35 
      @tarojs/components: 3.6.32 => 3.6.35 
      @tarojs/helper: 3.6.32 => 3.6.35 
      @tarojs/plugin-framework-vue3: 3.6.32 => 3.6.35 
      @tarojs/plugin-html: 3.6.32 => 3.6.35 
      @tarojs/runtime: 3.6.32 => 3.6.35 
      @tarojs/shared: 3.6.32 => 3.6.35 
      @tarojs/taro: 3.6.32 => 3.6.35 
      @tarojs/webpack5-runner: 3.6.32 => 3.6.35 
      babel-preset-taro: 3.6.32 => 3.6.35 
      eslint-config-taro: 3.6.21 => 3.6.21 
This was referenced Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant