Closed ozziexsh closed 7 years ago
@nehero It looks like you're hitting the v1
endpoints - is this intended? If so, you need to wrap your API calls in the Authenticate
method.
Otherwise you'll need to install the newer package to use with v2
.
npm install moltin@beta
Let me know if this helps 🙃
The docs say to use the v1 api? https://github.com/moltin/js-sdk#installation
I'm trying to grab the client-side SDK from npm. Do you only offer the CDN? I can grab it locally but that's kinda annyoing.
Installing via NPM using yarn add moltin@beta
and building gives me the error
These modules were not found:
* fs in ./~/node-localstorage/LocalStorage.js, ./~/graceful-fs/graceful-fs.js and 1 other
To install it, you can run: npm install --save fs
I'm assuming it's trying to pull the node version instead of the client one? Is there a client moltin sdk available on NPM?
@nehero That documentation is from the V1
branch of the repository. You'll find the README for the V2
compatible package here. A lot of this still in flux and work is still being done toward a stable release, hence why the package is tagged beta
and the old branch is the default here on GitHub.
The problem is occurring because of the lack of localStorage
on the server. I'll be working to fix that today, but in the meantime adding the below (👇) to your webpack config should fix the issue you're seeing.
node: {
fs: 'empty'
}
Getting a
401
error on/api/v1/products
andBuilding the app using Next.js / react. You don't need
moltin.Authenticate()
to list the products, correct?Contrived example below at what I'm trying to do