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

Cannot assign to read only property '0' of object '[object String]' #428

Closed
the-simian opened this issue Apr 9, 2017 · 15 comments
Closed

Comments

@the-simian
Copy link

application code-push-cli
Error Cannot assign to read only property '0' of object '[object String]'
Version 1.12.9-beta
command to repro code-push release-react CoolApp-Android android

stacktrace in console:

Detecting android app version:

/usr/local/lib/node_modules/code-push-cli/node_modules/deep-assign/index.js:28
		to[key] = val;
		        ^

TypeError: Cannot assign to read only property '0' of object '[object String]'
    at assignKey (/usr/local/lib/node_modules/code-push-cli/node_modules/deep-assign/index.js:28:11)
    at assign (/usr/local/lib/node_modules/code-push-cli/node_modules/deep-assign/index.js:43:4)
    at assignKey (/usr/local/lib/node_modules/code-push-cli/node_modules/deep-assign/index.js:30:13)
    at assign (/usr/local/lib/node_modules/code-push-cli/node_modules/deep-assign/index.js:43:4)
    at deepAssign (/usr/local/lib/node_modules/code-push-cli/node_modules/deep-assign/index.js:64:3)
    at deepParse (/usr/local/lib/node_modules/code-push-cli/node_modules/gradle-to-js/lib/parser.js:135:27)
    at deepParse (/usr/local/lib/node_modules/code-push-cli/node_modules/gradle-to-js/lib/parser.js:137:27)
    at ReadStream.<anonymous> (/usr/local/lib/node_modules/code-push-cli/node_modules/gradle-to-js/lib/parser.js:392:13)
    at emitOne (events.js:96:13)
    at ReadStream.emit (events.js:189:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at ReadStream.Readable.push (_stream_readable.js:134:10)
    at onread (fs.js:1839:12)
    at FSReqWrap.wrapper [as oncomplete] (fs.js:603:17)
@the-simian
Copy link
Author

the-simian commented Apr 9, 2017

This references issue
🔥 #420 🔥

@the-simian
Copy link
Author

looking at this line: https://github.com/Microsoft/code-push/blob/master/cli/script/command-executor.ts#L905

I can see that the .parseFile function doesn't hit the catch, becuse I am not seing an error about being Unable to parse the gradlefile. It appears at face value to be dying in the deep-assign dependency that is used by gradle-to-js

@the-simian
Copy link
Author

The problem appears to be in gradle-to-js. I'll submit an error report there.

@the-simian
Copy link
Author

@the-simian
Copy link
Author

the-simian commented Apr 9, 2017

Hey it seems that the problem fully lies in the underplaying gradle-to-js module, and I've submitted an issue there, since that's where it really belongs. I think its safe to close this, so I shall do so.

I've produced a very minimal example of the issue here that clearly proces its in the underlying module: https://github.com/the-simian/gradle-to-js-test

Thanks!

@max-mironov
Copy link
Contributor

max-mironov commented Apr 9, 2017

Hey @the-simian, thank you for your great investigation! All this information will be very useful for anyone who can get this error in future! We are appreciating your help with this.
Will try to monitor when this will be fixed in gradle-to-js package and will update our dependency accordingly.

@Chubacca
Copy link

If anyone else is still having trouble with this - I just commented out almost my entire gradle file (but left the version section) and was able to release. You can do the same until the gradle-to-js issue is fixed.

@dluksza
Copy link

dluksza commented Oct 13, 2017

I have the same issue in v2.0.2-beta

@ruslan-bikkinin
Copy link
Contributor

hi, @dluksza, we've been updated gradle-to-json to version 1.0.1 which has a fix for the issue and will release new code-push cli version soon. Can you please update from master to see if the issue is fixed?

@akshetpandey
Copy link

@ruslan-bikkinin I am also running into this issue and since neither yarn not npm support installing packages from a subfolder of a git repo, would it be possible to create a release tag from master called master or next.

@ruslan-bikkinin
Copy link
Contributor

@akshetpandey feel free to create fork of code-push repo and use it.

@dluksza
Copy link

dluksza commented Oct 17, 2017

@ruslan-bikkinin is there any guide how to update to master?

btw. For me removing dependences section from android/app/build.gradle fixed this issue and was able to push code to server.

@ruslan-bikkinin
Copy link
Contributor

ruslan-bikkinin commented Oct 17, 2017

@dluksza please follow these steps:

git clone git@github.com:Microsoft/code-push.git
cd code-push
npm i && gulp install && gulp link && gulp build
cd /path/to/your/app
#then you can use local code-push cli by executing this command
node path/to/cloned/code-push/cli/bin/script/cli.js 

@dluksza
Copy link

dluksza commented Oct 18, 2017

@ruslan-bikkinin I can that this error does not occur on current master (HEAD commit: f8932552024bd21936c2584973196521ce216484). Any ideas when it will be released?

@ruslan-bikkinin
Copy link
Contributor

@dluksza we are planning to release new version at the beginning of next week.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2021
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

6 participants