cartesia-ai / cartesia-js

The JavaScript client for the Cartesia API.
MIT License
54 stars 10 forks source link

Cannot import module Cartesia! #1

Closed OnlinePage closed 5 months ago

OnlinePage commented 5 months ago

Hi i tried using this in my node js app, (non es6) this way:

const Cartesia = require("@cartesia/cartesia-js");

And getting error:

Error: Cannot find module 'C:\Users\daddy\...\node_modules\@cartesia\cartesia-js\dist\index.js

Although I see the cartesia in my node modules folder installed: image

I tried re installation but same error!

kbrgl commented 5 months ago

Hi @OnlinePage, Node.js is not supported yet (our code is currently bundled for the browser), but adding support is high on our priorities.

neops1 commented 5 months ago

Same thing in nextjs ! Module not found: Can't resolve '@cartesia/cartesia-js'

sauhardjain commented 5 months ago

hey @neops1 we recently released an alpha version of our JavaScript client's v1 release on NPM—could you give that a go and see if it works for you? you can install it with npm install @cartesia/cartesia-js@alpha

our package uses the ES6 module system so try importing it as import Cartesia from "@cartesia/cartesia-js. if you're using Node, you'll have to add "type": "module" to your package.json

let us know if you run into any issues at all!