Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it compatible with NextJs #32

Open
lablack576 opened this issue Mar 27, 2024 · 4 comments
Open

Is it compatible with NextJs #32

lablack576 opened this issue Mar 27, 2024 · 4 comments

Comments

@lablack576
Copy link

I've been trying to use the npm package with NextJs. I installed it but when i add it to my code i get an error saying Cannot find module 'tls' I tried installing the model but it didn't work ?

@xRiddin
Copy link

xRiddin commented Apr 12, 2024

have you tried using it as server component? cuz tls, buffer, and fs doesn't work in client component.

@xRiddin
Copy link

xRiddin commented Apr 12, 2024

i've tried using it as server component, but no luck, still can't find module 'tls'.

@cheraff
Copy link

cheraff commented Apr 21, 2024

Same issue with NextJs. Will pay someone to add a NextJs example that converts a text stream (from openai or other) to audio as it's being streamed into the app, then streams to frontend play button, all within a NextJs app, streaming code via playht within a route, then called in frontend via play button on response - would be great!

Following example code here:
https://docs.play.ht/reference/nodejs-sdk

Errors:

Failed to compile.

▲ ./node_modules/playht/dist/esm/index.js:38555:1
▲ Module not found: Can't resolve 'http'

https://nextjs.org/docs/messages/module-not-found

..
▲ Module not found: Can't resolve 'stream'
▲ node:fs
▲ Module build failed: UnhandledSchemeError: Reading from "node:fs" is not handled by plugins (Unhandled scheme).
▲ Webpack supports "data:" and "file:" URIs by default.
▲ You may need an additional plugin to handle "node:" URIs.
...
▲ Import trace for requested module:
▲ node:fs
▲ ./node_modules/playht/dist/esm/index.js
▲ > Build failed because of webpack errors
▲ Error: Command "npm run build" exited with 1

..

When I explicitly state 'use server' it returns a 'tls' error, as noted by others in the discord

@ttanida
Copy link

ttanida commented May 6, 2024

I have the same problem.
The playHT node sdk doesn't seem to work with next.js.

Another person opened the same issue here:
#35 (comment)

I have tried a lot of different things, but nothing has worked so far.

I am looking into elevenlabs API now, since they also seem to support input text and output audio streaming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants