原生wx小程序转taro,编译问题。【Module not found: Can't resolve 'undefined' 】



    • 版本
    "@babel/runtime": "^7.7.7",
        "@tarojs/components": "3.1.1",
        "@tarojs/runtime": "3.1.1",
        "@tarojs/taro": "3.1.1",
        "@tarojs/react": "3.1.1",
        "react-dom": "^17.0.0",
        "react": "^17.0.0",
        "@tarojs/with-weapp": "^3.1.1"
    
    • 原生小程序转taro【一切按照官方步骤操作】
      taro convert 执行成功
    • 执行yarn dev:weapp 后报错

    c4dd5359d7d73ad710c0ddf8396dcfb.png

    bd824ee07406bc7d21049e74be65b6c.png

    app.js部分代码

    "use strict";
    // import { Block } from "@tarojs/components";
    import React from "react";
    import Taro from "@tarojs/taro";
    import withWeapp from "@tarojs/with-weapp";
    import "./app.scss";
    Object.defineProperty(exports, "__esModule", { value: true });
    var constant_1 = require("./common/constant.js");
    var httputils_1 = require("./network/httputils.js");
    var util_1 = require("./utils/util.js");
    
    @withWeapp({
    }, true)
    class App extends React.Component {
      render() {
        return this.props.children;
      }
    
    }
    
    export default App;
    

    微信开发者工具的报错。

    872969d9-365c-4b89-931a-224668046523-image.png



  • yarn dev:weapp的时候,版本是taro 3.0与之前是用taro 3.1一致,已解决



  • 怎么解决的啊·我也遇到了



  • @czz_kb 遇到一样的问题,怎么解决?


登录后回复