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

微信小程序半编译模式CompileMode没有效果 #17203

Open
experienceaigc opened this issue Jan 17, 2025 · 0 comments
Open

微信小程序半编译模式CompileMode没有效果 #17203

experienceaigc opened this issue Jan 17, 2025 · 0 comments

Comments

@experienceaigc
Copy link

experienceaigc commented Jan 17, 2025

相关平台

微信小程序

小程序基础库: 3.7.0
使用框架: React

复现步骤

使用最简Demo也可以复现
1、使用taro init compilemode-demo创建一个demo工程
2、参考半编译模式文档(https://taro-docs.jd.com/docs/optimized#%E5%8D%8A%E7%BC%96%E8%AF%91%E6%A8%A1%E5%BC%8F--compilemode)进行配置,配置Diff为:
diff --git a/config/index.ts b/config/index.ts
index 1e2f15c..27d304f 100644
--- a/config/index.ts
b/config/index.ts
@@ -44,6 44,9 @@ export default defineConfig<'vite'>(async (merge, { command, mode }) => {
}
}
},
experimental: {
compileMode: true
}
},
h5: {
publicPath: '/',
diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx
index b946310..1dc88ed 100644
--- a/src/pages/index/index.tsx
b/src/pages/index/index.tsx
@@ -8,7 8,7 @@ export default function Index () {
})

return (

  • Hello world!

)

Image

期望结果

正常输出半编译的模板代码,运行不报错

实际结果

[WXML Runtime warning] ./base.wxml
Template tmpl_0_true not found.
1 |
2 |

3 |
| ^
4 |
5 |
6 | Image

环境信息

👽 Taro v4.0.8


  Taro CLI 4.0.8 environment info:
    System:
      OS: macOS 14.5
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
      Yarn: 1.22.19 - /opt/homebrew/bin/yarn
      npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.8 => 4.0.8 
      @tarojs/components: 4.0.8 => 4.0.8 
      @tarojs/helper: 4.0.8 => 4.0.8 
      @tarojs/plugin-framework-react: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-alipay: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-h5: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-harmony-hybrid: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-jd: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-qq: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-swan: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-tt: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-weapp: 4.0.8 => 4.0.8 
      @tarojs/react: 4.0.8 => 4.0.8 
      @tarojs/runtime: 4.0.8 => 4.0.8 
      @tarojs/shared: 4.0.8 => 4.0.8 
      @tarojs/taro: 4.0.8 => 4.0.8 
      @tarojs/vite-runner: 4.0.8 => 4.0.8 
      babel-preset-taro: 4.0.8 => 4.0.8 
      eslint-config-taro: 4.0.8 => 4.0.8 
      react: ^18.0.0 => 18.3.1 

补充信息

因为这个是最简单的compileMode使用方式,之前看https://github.com/NervJS/taro/issues/16989这个也有类似的问题。
是不是在版本迭代中把compileMode功能改坏了?

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