Skip to content

Error: Cannot find module 'tls' #35

@yuripourre

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

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