NervJS / taro

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

4.0.3 无法使用原生模块 #16183

Open xyfll7 opened 3 months ago

xyfll7 commented 3 months ago

相关平台

微信小程序

复现仓库

git@github.com:NervJS/taro-sample-weapp.git 小程序基础库: 3.5.1 使用框架: React

复现步骤

按照官方文档即可复现 https://docs.taro.zone/docs/next/hybrid

期望结果

能够正常使用原生混合

实际结果

👽 Taro v4.0.3

Tips:

  1. 预览模式生成的文件较大,设置 NODE_ENV 为 production 可以开启压缩。 Example: $ set NODE_ENV=production && taro build --type weapp --watch

vite v4.5.3 building for production...

watching for file changes...

build started... transforming (1) taro:compilernode:internal/process/promises:391 triggerUncaughtException(err, true / fromPromise /); ^

[Error: ENOENT: no such file or directory, open 'D:\Users\l7\Documents\xyfs_sys\packages\my_test0\src\components\image-cropper{{imgSrc}}'] { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'D:\Users\l7\Documents\xyfs_sys\packages\my_test0\src\components\image-cropper\{{imgSrc}}' }

Node.js v20.16.0

环境信息

$ taro info
👽 Taro v4.0.3

  Taro CLI 4.0.3 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 20.16.0 - D:\Program Files\nodejs\node.EXE
      npm: 10.8.1 - D:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.3 => 4.0.3 
      @tarojs/components: 4.0.3 => 4.0.3 
      @tarojs/helper: 4.0.3 => 4.0.3 
      @tarojs/plugin-framework-react: 4.0.3 => 4.0.3 
      @tarojs/plugin-platform-alipay: 4.0.3 => 4.0.3 
      @tarojs/plugin-platform-h5: 4.0.3 => 4.0.3 
      @tarojs/plugin-platform-harmony-hybrid: 4.0.3 => 4.0.3 
      @tarojs/plugin-platform-jd: 4.0.3 => 4.0.3 
      @tarojs/plugin-platform-qq: 4.0.3 => 4.0.3
      @tarojs/plugin-platform-swan: 4.0.3 => 4.0.3
      @tarojs/plugin-platform-tt: 4.0.3 => 4.0.3
      @tarojs/plugin-platform-weapp: 4.0.3 => 4.0.3
      @tarojs/react: 4.0.3 => 4.0.3
      @tarojs/runtime: 4.0.3 => 4.0.3
      @tarojs/shared: 4.0.3 => 4.0.3
      @tarojs/taro: 4.0.3 => 4.0.3
      @tarojs/vite-runner: 4.0.3 => 4.0.3
      babel-preset-taro: 4.0.3 => 4.0.3
      eslint-config-taro: 4.0.3 => 4.0.3
      react: ^18.0.0 => 18.3.1
coolf commented 2 months ago

vue3 也是这样 [Error: ENOENT: no such file or directory, open '/Users/dingding/Documents/vue/src/components/dist/tag/{{image}}'] { errno: -2, code: 'ENOENT', syscall: 'open', path: '/Users/dingding/Documents/vue/src/components/dist/tag/{{image}}' }