The error tells you that there is an error but you don´t catch it. This is how you can catch it:
getAllPosts().then(response => { console.log(response); }).catch(e => { console.log(e); });
You can also just put a console.log(reponse)
at the beginning of your API callback function, there is definitely an error message from the Graph API in it.
More information: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
Or with async/await:
//some async function try { let response = await getAllPosts(); } catch(e) { console.log(e); }
Related Posts:
- FB is not defined javascript
- How to change CSS using jQuery?
- How to properly use jsPDF library
- Start script missing error when running npm start
- Uncaught SyntaxError: Unexpected token u in JSON at position 0
- How can I scroll to an element using jQuery?
- I am getting an “Invalid Host header” message when connecting to webpack-dev-server remotely
- How can you encode a string to Base64 in JavaScript?
- jQuery Get Selected Option From Dropdown
- How to create multidimensional array
- Open a URL in a new tab (and not a new window)
- What does this symbol mean in JavaScript?
- React: trigger onChange if input value is changing by state?
- Jquery : Refresh/Reload the page on clicking a button
- (change) vs (ngModelChange) in angular
- You should not use Route or withRouter() outside a Router when using react-router 4 and styled-component in react
- React-Router only one child
- What is the most efficient way to deep clone an object in JavaScript?
- How do I format date in jQuery datetimepicker?
- Express Render not working return error: No default engine was specified and no extension was provided
- Remove Object from Array using JavaScript
- Angular4 – No value accessor for form control
- What is the difference between ( for… in ) and ( for… of ) statements?
- TypeError: Cannot read property “0” from undefined
- How to use npm jquery module?
- Cannot read property ‘bind’ of undefined. React.js
- Why is my asynchronous function returning Promise {
} instead of a value? - NodeJs : TypeError: require(…) is not a function
- Sort array by firstname (alphabetically) in Javascript
- Sorting arrays in javascript by object key value
- How do I get an element to scroll into view, using jQuery?
- document.getElementById not working / Display
- jQuery: Check if div with certain class name exists
- Objects are not valid as a React child. If you meant to render a collection of children, use an array instead
- Error: ENOENT: no such file or directory, stat ‘/public/main.html’ at Error (native)
- Print PDF directly from JavaScript
- Set value of hidden input with jquery
- How does AJAX work?
- How to remove all duplicates from an array of objects?
- Finding the average of an array using JS
- Creating a div element in jQuery
- e.target.value on an input field ReactJs, how does it work?
- How do you convert a JavaScript date to UTC?
- Remove all special characters with RegExp
- jQuery: Get selected element tag name
- Does ECMAScript 6 have a convention for abstract classes?
- Why is jquery show() not working in example
- console.log showing contents of array object
- How can I use jQuery to run MySQL queries?
- Using setTimeout on promise chain
- Regular Expression to reformat a US phone number in Javascript
- javascript push multidimensional array
- How can I know which radio button is selected via jQuery?
- jquery toggleClass not working
- Positioning element at center of screen
- Get hours difference between two dates in Moment Js
- JQuery Number Formatting
- How to add jQuery in JS file
- Get query string parameters url values with jQuery / Javascript (querystring)
- trying to enqueue script in wordpress
- Does javascript have an equivalent to PHP’s preg_replace_callback?
- WP REST – video and audio players
- Headless WordPress: How to authenticate front end requests?
- Inserting ads within content
- Theme Customiser not live previewing changes on pseudo elements
- Instantiate TinyMCE via JS ( rather than PHP/wp_editor )
- Move all the JS files to the bottom|footer, the right way
- How to handle Gutenberg wp.data async errors?
- How do I access site and block editor state data and use `useSelect()` or `withSelect()` to bind it to my components?
- wp_enqueue_scripts is not working in my plugin
- How to retrieve a value from an input field in a media view template
- Any required callbacks to WP.com or WP.org?
- Gutenberg extend blocks add new class name
- Modal working only on home page
- best way for app users to submit blog post?
- how to localized scripts of new page requested by ajax?
- Why is JavaScript being added to header as application/oembed?
- Add JavaScript to all WooCommerce Products
- On click load iframe [closed]
- Javascript for a specific wordpress page
- php variable inside javascript code
- How to add a onclick attribute to a list of checkboxes?
- Show a popup message when file is uploaded
- How to validate image with specific height and width selection in media selector
- internal anchor links no longer working after upgrade
- Generating dynamically Schema LD+JSON microdata with Javascript works in test environment but not in WP
- on change form submit variable value not updating
- youtube full screen on off permater code help for wordpress
- Select parent from child class name then add another class name to the parent
- How do I make a savable preview like Youtube Gutenberg block?
- iFrame onLoad in custom Gutenberg block
- Taxinomy slug as var in parent archive page, without having a specific taxinomy page
- How To Pull Information From A Page And Input The Data In The WordPress User Database Table
- How to register or enqueue script and stop it being called in head?
- WordPress 4.1 crashes loading of ArcGIS Javascript API
- convertEntities() used before it is defined
- JavaScript: TypeError: xyz is not a function after upgrading WordPress
- JavaScript file successfully registered but does not render correctly
- Orbit Slider and Events Manager Plug-in JavaScript
- Theme path of WordPress inside javascript file