jakiestfu / stability-ts

DreamStudio Client written in TypeScript
156 stars 33 forks source link

Unexpected token ? crash #3

Closed web-gan closed 1 year ago

web-gan commented 1 year ago

Hi! Recently installed this through NPM and am trying to run it on a backend server. The app is currently crashing with the following error:

SyntaxError: Unexpected token '?' where you're setting const requestId = draft.requestId ?? uuid4()

Let me know if you have any ideas! Thanks!

jakiestfu commented 1 year ago

What version of node are you using?

jakiestfu commented 1 year ago

Added some babel transpilation, this should be fixed in version 1.2.0

jakiestfu commented 1 year ago

@web-gan Did this fix your issues?

web-gan commented 1 year ago

Hey there - thanks for circling back. This did fix the issue, thanks! Just running into another where it doesn't seem to actually be making the call to DreamStudio (no credits are dropping from my account). I wonder if this has to do with me using this in a JS file and not Typescript?

jakiestfu commented 1 year ago

@web-gan Well I'm using webpack and babel now to convert to JS so it shouldn't be an issue. Can you console log the arguments for me of the end function and share them here? There could be an error message in there.

api.on('end', (data) => {
  console.log('Generating Complete', data)
})
web-gan commented 1 year ago

This was a typo on my end! Was using token instead of apiKey. Thanks for the help! All is working now!

jakiestfu commented 1 year ago

That was actually my fault! It was a typo in the readme 😭 It's since been fixed. Thanks!