question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React-native issue : entry wont update

See original GitHub issue

I think I’ve tried all possible combinations but none of them seem to work. What do I do wrong ?

First :

client.getSpace('<SPACEID>')
    .then((space) => {
         space.updateEntry({
         "sys": {
         id: "<ENTRYID>",
         version:45
          },
         "fields": {
         "job": {
           "fr-FR": "blablabla"
            }
         }
     })
})

=> Unhandled promise rejection TypeError: space.updateEntry is not a function

Second :

client.getSpace('<SPACEID>')
		.then((space) => {
		  space.getEntry(<ENTRYID>)
			.then((entry) => {
				var ver = entry.sys.version
				var id = entry.sys.id
				entry = {
					"sys":{
						id: id,
						version:ver
					},
					"fields": {
						"job": {
							"fr-FR": "blablabla"
						}
					}
				}
				entry.update()
			})
		})

=> got entry.update() is not a function

Third :

		.then((space) => {
		  space.getEntry(entryId)
			.then((entry) => {
				entry.fields.job = {"fr-FR": "blabla"}
				entry.update()
			})
		})

=> got Exception ‘-[__NSCFNumber length]: unrecognized selector sent to instance 0xb0000000000002d3’

Fourth :

entry.fields.job['fr-FR'] = 'blabla'

=> same exception

ExceptionsManager.js:78 Exception '-[__NSCFNumber length]: unrecognized selector sent to instance 0xb000000000000013' was thrown while invoking sendRequest on target RCTNetworking with params (
        {
        data =         {
            string = "{\"fields\":{\"fireid\":{\"fr-FR\":\"bla\"},\"commission\":{\"fr-FR\":\"bla\"},\"dep\":{\"fr-FR\":\"bla\"},\"desc\":{\"fr-FR\":\"bla\"},\"email\":{\"fr-FR\":\"thp@ggg.com\"},\"firstname\":{\"fr-FR\":\"firstname\"},\"job\":{\"fr-FR\":\"blabla\"},\"name\":{\"fr-FR\":\"name\"},\"tel\":{\"fr-FR\":\"0675234573\"},\"type\":{\"fr-FR\":\"Collaborateur\"}}}";
            trackingName = unknown;
        };
        headers =         {
            accept = "application/json, text/plain, */*";
            authorization = "Bearer TOKEN";
            "content-type" = "application/vnd.contentful.management.v1+json";
            "x-contentful-user-agent" = "contentful-management.js/1.3.1";
            "x-contentful-version" = 1;
        };
        incrementalUpdates = 0;
        method = PUT;
        responseType = text;
        timeout = 0;
        url = "https://api.contentful.com:443/spaces/<SPACEID>/entries/<ENTRYID>";
    },
    139
)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
philohelpcommented, Feb 18, 2017

Question opened in SO : http://stackoverflow.com/questions/42314820/contentful-content-management-node-lib-entry-wont-update Problem probably related with axios / react-native. Got the API working with Fetch - lower level & old school solution but well, it works.

0reactions
Khaledgarbayacommented, Apr 24, 2017

I am closing this issue for now please feel free to create a new one if you still have the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reloading App not updating for the latest modified code RN ...
Whenever I start the app in Virtual Device, it loads the Previous build. I have to manually build the app again using command...
Read more >
React native run-android do not updating modified code
When i ran react-native init albums , it was just an index.js file that was created, there was no index.android.js or index.ios.js file...
Read more >
Troubleshooting - React Native
You will also need to update your applications to load the JavaScript bundle from the new port. If running on device from Xcode,...
Read more >
react-native-code-push - npm
Run your staging/beta build of your app, sync the update from the server, and verify it works as expected. Promote the tested release...
Read more >
Releasing CodePush updates using the App Center CLI
Running the react-native bundle command to generate the update contents (JS bundle and assets) that will be released to the CodePush server. It ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found