Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Error: Cannot find module 'tls' #35

Description

@yuripourre

Hello, I am following the steps in the documentation.

I am trying to add PlayHT to a project using next.js and webpack 5 but I am getting this error when I tried to call the listVoices method.

I get this error:

Error: Cannot find module 'tls'
...
 ⚠ ./node_modules/playht/dist/esm/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

I tried this config but it didn't work:

const nextConfig = {
    webpack: (config) => {
        config.resolve.fallback = { tls: false };
        return config;
    },
};
export default nextConfig;

Do you guys have any ideas what I am doing wrong?

Edit:

I just found this link from someone with the same problem
https://stackoverflow.com/questions/77830195/playht-integration-with-nextjs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions