Skip to content

Attempted to assign to readonly property #25

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

Closed
naturalfreak opened this issue May 23, 2017 · 8 comments
Closed

Attempted to assign to readonly property #25

naturalfreak opened this issue May 23, 2017 · 8 comments
Labels

Comments

@naturalfreak
Copy link

When I use this plugin I got this error in AOT compilation.

JS ERROR TypeError: Attempted to assign to readonly property.

tns version 3.0
IOS device only.

tsconfig.json

{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"lib": [
"es6",
"dom",
"es2015.iterable"
],
"baseUrl": ".",
"paths": {
"": [
"./node_modules/tns-core-modules/
",
"./node_modules/"
]
}
},
"exclude": [
"node_modules",
"platforms",
"**/
.aot.ts"
]
}

tsconfig.aot.json

{
"extends": "./tsconfig",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"application": ["node_modules/tns-core-modules/application"],
"application-settings": ["node_modules/tns-core-modules/application-settings"],
"camera": ["node_modules/tns-core-modules/camera"],
"color": ["node_modules/tns-core-modules/color"],
"connectivity": ["node_modules/tns-core-modules/connectivity"],
"console": ["node_modules/tns-core-modules/console"],
"data/": ["node_modules/tns-core-modules/data/"],
"fetch": ["node_modules/tns-core-modules/fetch"],
"file-system": ["node_modules/tns-core-modules/file-system"],
"fps-meter": ["node_modules/tns-core-modules/fps-meter"],
"globals": ["node_modules/tns-core-modules/globals"],
"http": ["node_modules/tns-core-modules/http"],
"image-asset": ["node_modules/tns-core-modules/image-asset"],
"image-source": ["node_modules/tns-core-modules/image-source"],
"location": ["node_modules/tns-core-modules/location"],
"platform": ["node_modules/tns-core-modules/platform"],
"text": ["node_modules/tns-core-modules/text"],
"timer": ["node_modules/tns-core-modules/timer"],
"trace": ["node_modules/tns-core-modules/trace"],
"ui/": ["node_modules/tns-core-modules/ui/"],
"utils/": ["node_modules/tns-core-modules/utils/"],
"xhr": ["node_modules/tns-core-modules/xhr"],
"xml": ["node_modules/tns-core-modules/xml"]
},
"skipLibCheck": true
},
"exclude": [
"node_modules",
"platforms"
],
"angularCompilerOptions": {
"skipMetadataEmit": true,
"genDir": "./"
}
}

package.json

"dependencies": {
"@angular/animations": "^4.1.3",
"@angular/common": "^4.1.3",
"@angular/compiler": "^4.1.3",
"@angular/core": "^4.1.3",
"@angular/forms": "^4.1.3",
"@angular/http": "^4.1.3",
"@angular/platform-browser": "^4.1.3",
"@angular/platform-browser-dynamic": "^4.1.3",
"@angular/router": "^4.1.3",
"nativescript-angular": "^3.0.0",
"nativescript-camera": "^3.0.0",
"nativescript-facebook": "^1.0.1",
"nativescript-fresco": "^3.0.2",
"nativescript-geolocation": "^3.0.0",
"nativescript-google-maps-sdk": "^2.1.1",
"nativescript-imagepicker": "^3.0.1",
"nativescript-iqkeyboardmanager": "^1.0.1",
"nativescript-push-notifications": "^0.1.3",
"nativescript-socket.io": "^0.5.1",
"nativescript-telerik-ui-pro": "./packages/nativescript-ui-pro.tgz",
"reflect-metadata": "^0.1.10",
"rxjs": "~5.4.0",
"tns-core-modules": "^3.0.0",
"zone.js": "~0.8.11"
},
"devDependencies": {
"@angular/compiler-cli": "~4.1.3",
"@ngtools/webpack": "1.3.1",
"babel-traverse": "6.24.1",
"babel-types": "6.24.1",
"babylon": "6.17.0",
"codelyzer": "^3.0.0",
"copy-webpack-plugin": "~4.0.1",
"extract-text-webpack-plugin": "~2.1.0",
"filewalker": "^0.1.3",
"jasmine-core": "^2.4.1",
"karma": "^1.6.0",
"karma-jasmine": "^1.0.2",
"karma-nativescript-launcher": "^0.4.0",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.1",
"nativescript-dev-android-snapshot": "0.0.9",
"nativescript-dev-typescript": "^0.4.5",
"nativescript-dev-webpack": "^0.5.0",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.0.2",
"tslint": "^5.3.2",
"typescript": "^2.3.3",
"webpack": "~2.6.0",
"webpack-sources": "~0.2.3"
}

@angeltsvetkov
Copy link
Contributor

Great catch @naturalfreak . This is the fix.
There is a discussion regarding this issue here.

Please let me know whether it is working on your side.

@naturalfreak
Copy link
Author

No, unfortunately this fix is not working.

@angeltsvetkov
Copy link
Contributor

Did you delete the platforms folder of your app?

@naturalfreak
Copy link
Author

Yes, that was the first thing, I did.

@angeltsvetkov
Copy link
Contributor

I just did the following steps:

  1. Clone the repo (and then navigate to it cd nativescript-facebook)
  2. cd src (this is where the plugin is)
  3. Install its dependencies (npm i)
  4. tsc (By the way my typescript version is 2.2.2)
  5. Open demo app (cd ../demo)
  6. Install its dependencies (npm i)
  7. Build and bundle (npm run build-ios-bundle)

And it's finished successfully. Prior to the fix it fails with exactly the same error you mentioned.

Could you try these steps and tell me whether you managed to build and bundle the demo app?

@naturalfreak
Copy link
Author

Yes, it's working.

  1. Clone the repo (and then navigate to it cd nativescript-facebook)
  2. cd src (this is where the plugin is)
  3. Install its dependencies (npm i)
  4. npm pack

Using built package everything works fine in my project.

@angeltsvetkov
Copy link
Contributor

Great to hear that!
Should we close the issue?

@naturalfreak
Copy link
Author

Yes.

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

No branches or pull requests

2 participants