Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Webpack do not work for "this.constructor = d;" #32

Closed
hdeshev opened this issue Sep 26, 2016 · 2 comments
Closed

Webpack do not work for "this.constructor = d;" #32

hdeshev opened this issue Sep 26, 2016 · 2 comments

Comments

@hdeshev
Copy link
Contributor

hdeshev commented Sep 26, 2016

From @ignaciolarranaga on September 4, 2016 21:9

For example it does not work for the geolocation module, because of this code (extracted from the bundled code):

!*** ../~/nativescript-geolocation/nativescript-geolocation.ios.js ***!
  \*********************************************************************/
/***/ function(module, exports, __webpack_require__) {

    "use strict";
    var __extends = (this && this.__extends) || function (d, b) {
        for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };

At runtime it throws:

Sep  4 18:04:19 MacBook-Pro-de-Ignacio xxxx[51653]: 1   0x108ff4c67 -[TNSRuntime executeModule:]
Sep  4 18:04:19 MacBook-Pro-de-Ignacio xxxx[51653]: 2   0x106194322 main
Sep  4 18:04:19 MacBook-Pro-de-Ignacio xxxx[51653]: 3   0x10bb6e92d start
Sep  4 18:04:19 MacBook-Pro-de-Ignacio xxxx[51653]: 4   0x1
Sep  4 18:04:19 MacBook-Pro-de-Ignacio xxxx[51653]: file:///app/bundle.js:145226:26: JS ERROR TypeError: Attempted to assign to readonly property.
Sep  4 18:04:19 MacBook-Pro-de-Ignacio com.apple.CoreSimulator.SimDevice.00A4117D-42D7-4D34-A741-4D4FAA4286CD.launchd_sim[96565] (UIKitApplication:com.gynto.client[0x5ed0][51653]): Service exited due to signal: Segmentation fault: 11

This is just an example, but also happen to me on other modules. The only pattern I was able to found is that happends at: function __() { this.constructor = d; }

Copied from original issue: NativeScript/nativescript-dev-webpack#16

@hdeshev
Copy link
Contributor Author

hdeshev commented Sep 26, 2016

I think the iOS runtime has issues with code using the "use strict" declaration. I think nativescript-geolocation has to be compiled without that.

@hdeshev
Copy link
Contributor Author

hdeshev commented Sep 27, 2016

Fixed in nativescript-geolocation@0.0.13.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant