Closed kristoferblack closed 8 years ago
Hi,
What version of the kit are you using? Is it in NodeJS or in browser?
Hey, I'm using the latest one, 2.0.1. I'm using it in the browser in a React app. Using Webpack.
I've fixed a few typos in the README but I don't think that was the cause of your problem.
Here the block of code works: https://jsfiddle.net/erwanl/ggbsbju5/
Can you post somewhere a minimal project where the issue is reproduced?
Basically the Prismic.api
function is the getApi method:
https://github.com/prismicio/javascript-kit/blob/master/lib/prismic.js#L71
Defined here: https://github.com/prismicio/javascript-kit/blob/master/lib/prismic.js#L27
and it does return a promise.
Thanks for the info. I figured out the problem and it's totally on my end. It appears that NPM defaulted to installing an old version of the package... 1.4.0. I uninstalled and forced npm to install a fresh 2.0.1 version. Working now.
I'm getting an error when trying to use the promises syntax described on the readme:
I just keep getting
Uncaught TypeError: Prismic.Api(...).then is not a function
in console.Any thoughts?