Closed Maybach91 closed 1 year ago
hmm.. This error alone doesn't seem like enough information to diagnose 🤔 There shouldn't be any reason localhost is a factor. Maybe try using axios directly and see if you're getting the same error.
I see you mention node 18, but your error appears to be a browser error. Are you attempting to load this client-side (in browser)?
I see you mention node 18, but your error appears to be a browser error. Are you attempting to load this client-side (in browser)?
@johnagan yes, I’m trying to access it via client-side, I thought it’s possible with this library. But i know the API only works server side, right?
Correct - It's a node.js library and not tested in the browser. Though, I'm not sure why it wouldn't work in the browser also. Which bundler are you using?
Also curious how you are handling access tokens in the client 🤔 Seems risky.
For production i will use something like vercel for deployment and use env vars for the tokens, that should work, i think.
I’m using vite@3.2.3
as a bundler.
You're exposing your access token in the client that way 😦
If I understand what your build is, the env variables will just populate into your compiled client code
Closing out since I don't believe there is a change needed. Let us know if you're still having trouble!
Using the basic instructions to access the API like stated in the readme, i cannot make it work using it in my local environment.
I have a API Token and try to access the API via the following:
But this shows me the following console error:
Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
for this line:RedirectableRequest.prototype = Object.create(Writable.prototype);
Is the reason because i’m trying to access it via localhost or is there something wrong with the package/my environment? Using
node@v18.3.0
,yarn@3.2.1
webflow-api@^1.2.0
andvite@^3.2.3