编译运行一步一个坑,你们的破文档能改改吗?



  • @Taro-小助手-honly 我头一天是用的dev:h5,第二天用成build:h5了,结果就说编译文件过大,暂时还没研究这个问题,我现在都用dev:h5就可以

    WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
    Entrypoints:
      app (306 KiB)
          css/app.css
          js/app.js
    


  • @xiaoli048 污哥,这个是什么原因呀



  • 觉得文档哪里有问题可以提 PR 或者在 issue 里说明。



  • @Taro-小助手-honly
    给官方个建议啊。。前面都没问题,就是clone空壳开始,各种坑。。
    首先,clone的地址有问题,clone不下来;
    然后进入git,用git上面提供的地址clone下来之后,不知道放在哪儿;
    然后,放到了项目根目录,进去npm i,缺少东西,现在我知道缺少的这个fsevents是npm出的问题,得手动配置一下mac的package。json文件才行;
    然后,npm安装完成之后,run的时候,提示react-native和相关的依赖,在应用里面找到了两份。。
    从这边开始往后希望能优化一下,要不像我这样折腾了三天了还是没弄好。。



  • @tinico 这只是个warning,告诉你文件有点大了可以考虑优化了,代码还是跑的。



  • bcce8c0c-6b90-4a5b-8880-b342afc4aa1a-image.png
    觉得哪里可以优化可以直接编辑的。



  • @13691505478_p大佬,rn项目跑不起来,可以请教一下怎么跑起来吗

    1. 项目npm run dev:rn
      2.将编译好的rn_temp,拖到taro-native-shell根目录,再执行npm install
      5d731475-4c18-45ca-8580-5eb1e339532a-image.png
      3.react-native run-android
      0648f951-f45e-49af-a461-94060ea44b4f-image.png
      81e3629e-5c88-481f-957e-b4d7f40396a1-image.png
      The development server returned response error code: 500

    URL: http://10.0.2.2:8081/rn_temp/index.delta?platform=android&dev=true&minify=false

    Body:
    {"originModulePath":"E:\taro-native-shell-master\rn_temp\app.js","targetModuleName":"@tarojs/components-rn","message":"Unable to resolve module @tarojs/components-rn from E:\\taro-native-shell-master\\rn_temp\\app.js: Module @tarojs/components-rn does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache. 4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.","errors":[{"description":"Unable to resolve module @tarojs/components-rn from E:\\taro-native-shell-master\\rn_temp\\app.js: Module @tarojs/components-rn does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache. 4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*."}],"name":"Error","stack":"Error: Unable to resolve module @tarojs/components-rn from E:\\taro-native-shell-master\\rn_temp\\app.js: Module @tarojs/components-rn does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache. 4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.\n at ModuleResolver.resolveDependency (E:\taro-native-shell-master\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:161:1460)\n at ResolutionRequest.resolveDependency (E:\taro-native-shell-master\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:91:16)\n at DependencyGraph.resolveDependency (E:\taro-native-shell-master\node_modules\metro\src\node-haste\DependencyGraph.js:272:4579)\n at dependencies.map.relativePath (E:\taro-native-shell-master\node_modules\metro\src\DeltaBundler\traverseDependencies.js:376:19)\n at Array.map (<anonymous>)\n at resolveDependencies (E:\taro-native-shell-master\node_modules\metro\src\DeltaBundler\traverseDependencies.js:374:16)\n at E:\taro-native-shell-master\node_modules\metro\src\DeltaBundler\traverseDependencies.js:212:33\n at Generator.next (<anonymous>)\n at step (E:\taro-native-shell-master\node_modules\metro\src\DeltaBundler\traverseDependencies.js:297:313)\n at E:\taro-native-shell-master\node_modules\metro\src\DeltaBundler\traverseDependencies.js:297:473"}
    processBundleResult
    BundleDownloader.java:266
    access$200
    BundleDownloader.java:35
    onResponse
    BundleDownloader.java:153
    execute
    RealCall.java:153
    run
    NamedRunnable.java:32
    runWorker
    ThreadPoolExecutor.java:1167
    run
    ThreadPoolExecutor.java:641
    run
    Thread.java:919



  • @jd_61118b9c9b0c0 错误提示很清楚啊,依赖没有安装,你在 taro-native-shell 项目没有 npm install 。



  • @jd_5821561ab3bc5 taro文档确实应该更新一下。按文档的方式,打包apk安装到真机,在真机上根本无法正常运行,只会闪退。



  • @244566883-757876 闪退可能的原因很多,具体要看报错栈的。



  • @蜘蛛paipai 你好 我已经install了 一开始还以为是被墙的原因 后面开着梯子全局install都没有用 还是这个报错 Module @tarojs/components-rn does not exist in the Haste module map 请问是哪里需要配置的吗 我的是window系统 文档的是mac



  • 多半是缓存,运行一下 react-native start --reset-cache



  • @jd_61118b9c9b0c0 请问这个问题你解决了吗?我也遇到同样问题了


登录后回复