NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.13k stars 4.75k forks source link

开启半编译模式 —— CompileMode报错 #15252

Open hcweb opened 5 months ago

hcweb commented 5 months ago

微信图片_20240221190532

相关平台

微信小程序

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

复现步骤

按照文档开启半编译模式 —— CompileMode报错

期望结果

开启半编译模式 —— CompileMode报错

实际结果

开启半编译模式 —— CompileMode报错

环境信息

👽 Taro v3.6.23

  Taro CLI 3.6.23 environment info:
    System:
      OS: Windows 11 10.0.22621
    Binaries:
      Node: 18.19.0 - D:\soft\node18\node.EXE
      Yarn: 1.22.21 - D:\npm_wrokspace\yarn.CMD
      npm: 10.4.0 - D:\soft\node18\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.23 => 3.6.23
      @tarojs/components: 3.6.23 => 3.6.23
      @tarojs/helper: 3.6.23 => 3.6.23
      @tarojs/plugin-framework-react: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-alipay: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-h5: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-jd: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-qq: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-swan: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-tt: 3.6.23 => 3.6.23
      @tarojs/plugin-platform-weapp: 3.6.23 => 3.6.23
      @tarojs/react: 3.6.23 => 3.6.23
      @tarojs/runtime: 3.6.23 => 3.6.23
      @tarojs/shared: 3.6.23 => 3.6.23
      @tarojs/taro: 3.6.23 => 3.6.23
      @tarojs/taro-loader: 3.6.23 => 3.6.23
      @tarojs/webpack5-runner: 3.6.23 => 3.6.23
      babel-preset-taro: 3.6.23 => 3.6.23
      eslint-config-taro: 3.6.23 => 3.6.23
      react: ^18.0.0 => 18.2.0
Chen-jj commented 4 months ago

@hcweb 麻烦提供一下demo

w599098780 commented 3 months ago

解决了吗?同样的报错

ct-0902 commented 2 weeks ago

@hcweb 麻烦提供一下demo

目前我这也出现这个问题了,这个是因为windows下开启compileMode,template里面的相对路径会被编译成/导致引用路径找不到,只能先手动改成\才能正常访问,mac下是没有问题的。并且compileMode下引入的wxs相对路径在template模版里也是不对的。