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

编译成h5正常,编译成小程序后各种报错 #1128

Closed
RubbbbbY opened this issue Nov 15, 2018 · 5 comments
Closed

编译成h5正常,编译成小程序后各种报错 #1128

RubbbbbY opened this issue Nov 15, 2018 · 5 comments

Comments

@RubbbbbY
Copy link

问题描述
打包成H5页面是正常的
e0c52b079964336804939915210caf8
然后编译成小程序后,就全乱了
image

复现步骤
[复现问题的步骤]

[或者可以直接贴源代码,能贴文字就不要截图]

// 这里可以贴代码

期望行为
[这里请用简洁清晰的语言描述你期望的行为]
解决编译成小程序报错问题
报错信息

[这里请贴上你的完整报错截图或文字]
image

系统信息

  • 操作系统: [e.g. Windows 10]
  • Taro 版本 [e.g. v.0.0.64]
  • Node.js 版本 [e.g. v9.0.0]
  • 报错平台 [ weapp]

补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]

@luckyadam
Copy link
Member

Taro 版本多少
然后报错这里进去看下
image

@RubbbbbY
Copy link
Author

Taro 版本多少
然后报错这里进去看下
image

Taro版本 v1.0.7 下面是点进去后的代码

`define("pages/govt/TaskDetial/TaskDetial.js", function(require, module, exports, window,document,frames,self,location,navigator,localStorage,history,Caches,screen,alert,confirm,prompt,fetch,XMLHttpRequest,WebSocket,webkit,WeixinJSCore,Reporter,print,URL,DOMParser,upload,preview,build,showDecryptedInfo,syncMessage,checkProxy,showSystemInfo,openVendor,openToolsLog,showRequestInfo,help,showDebugInfoTable,closeDebug,showDebugInfo,__global,WeixinJSBridge){ "use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };

var _index = require("../../../npm/@tarojs/taro-weapp/index.js");

var _index2 = _interopRequireDefault(_index);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.proto = superClass; }

var banner = "/assets/img/banner.jpg";

var TaskDetial = function (_BaseComponent) {
_inherits(TaskDetial, _BaseComponent);

function TaskDetial() {
var _ref;

var _temp, _this, _ret;

_classCallCheck(this, TaskDetial);

for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  args[_key] = arguments[_key];
}

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TaskDetial.__proto__ || Object.getPrototypeOf(TaskDetial)).call.apply(_ref, [this].concat(args))), _this), _this.$usedState = ["tabList", "banner", "current"], _this.handleClick = function (e) {
  _this.setState({
    current: e
  });
}, _this.$$refs = [], _temp), _possibleConstructorReturn(_this, _ret);

}

_createClass(TaskDetial, [{
key: "componentWillMount",
value: function componentWillMount() {}
}, {
key: "componentDidMount",
value: function componentDidMount() {}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {}
}, {
key: "componentDidShow",
value: function componentDidShow() {}
}, {
key: "componentDidHide",
value: function componentDidHide() {}
}, {
key: "_constructor",
value: function _constructor(props) {
_get(TaskDetial.prototype.proto || Object.getPrototypeOf(TaskDetial.prototype), "_constructor", this).call(this, props);
this.state = {
current: 0
};
}
}, {
key: "_createData",
value: function _createData() {
this.__state = arguments[0] || this.state || {};
this.__props = arguments[1] || this.props || {};

  var env = "weapp";
  var tabList = [{ title: '任务详情' }, { title: '提交结果' }];
  Object.assign(this.__state, {
    tabList: tabList,
    banner: banner
  });
  return this.__state;
}

}]);

return TaskDetial;
}(_index.Component);

TaskDetial.properties = {};
TaskDetial.$$events = ["handleClick"];
TaskDetial.options = {
addGlobalClass: true
};
exports.default = TaskDetial;

Component(require('../../../npm/@tarojs/taro-weapp/index.js').default.createComponent(TaskDetial, true));
});`

@RubbbbbY
Copy link
Author

补张图
image

@luckyadam
Copy link
Member

麻烦给下这个页面代码

@taro-bot
Copy link

taro-bot bot commented Nov 19, 2018

Hello~

您的问题我们无法复现。如果有空的话还请拔冗提供一个简单的复现 demo,否则这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

@taro-bot taro-bot bot removed the to be closed label Dec 4, 2018
@taro-bot taro-bot bot closed this as completed Dec 4, 2018
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

3 participants