Vyro-ai / imagine-sdk-js

Official Imagine Typescript SDK. With this SDK, developers can effortlessly integrate Imagine's industry leading text to image generation capabilities into their Typescript or Javascript applications.
Apache License 2.0
21 stars 3 forks source link

Module not found: Default condition should be last one #5

Open ayanokoujifl opened 1 year ago

ayanokoujifl commented 1 year ago

Module not found: Default condition should be last one

I get this error when i'm try to import { GenerationStyle, client, Status } from "imaginesdk"

This code:

    
import { GenerationStyle, client, Status } from "imaginesdk"
const imagine = client("API_KEY")

export const generateImage = async (prompt: string) => {
  const response = await imagine.generations(prompt, {
    style: GenerationStyle.ANIME,
  })
  if (response.status() === Status.OK) {
    const image = response.getOrThrow()
    image.asFile("output.png")
  } else {
    console.log(response.errorOrThrow())
  }
}
    

I'm using NextJS, React ^18

This is the example code from the documentation, and the module was correctly imported, I need help, please.

ayanokoujifl commented 1 year ago

The error is on import {client}, how to solve?

unobrandon commented 10 months ago

I get the same error on import {client}. How to solve?