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

ESM Import Fails: Missing .js Extensions in Telnyx Dist #191

Open
Dextario opened this issue Dec 29, 2024 · 2 comments
Open

ESM Import Fails: Missing .js Extensions in Telnyx Dist #191

Dextario opened this issue Dec 29, 2024 · 2 comments

Comments

@Dextario
Copy link

Dextario commented Dec 29, 2024

Please only file issues here that you believe represent actual bugs or
feature requests for the Telnyx Node library.

If you're having general trouble with your Telnyx integration, please reach out
to support using the form at https://support.telnyx.com/ (preferred) or via
email to [email protected].

If you are reporting a bug, please include your Node version and the version of
the Telnyx Node library you're using, as well as any other details that may be
helpful in reproducing the problem.

Bug:
When using Node.js ESM ("type": "module"), imports inside node_modules/telnyx/dist/ (e.g., import { createTelnyx } from './telnyx') are missing the .js extension. This causes Node to throw:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../telnyx/dist/telnyx' ... Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../telnyx/dist/utils' ...

To Reproduce"
Set "type": "module" in package.json.

Install the latest Telnyx version: npm install telnyx.

In your code, do:

import Telnyx from 'telnyx';
const client = new Telnyx('api key');

Run in node v20.17.0+ env

@lucasassisrosa
Copy link
Contributor

Hello @Dextario,

Thanks for submitting this issue. Could you please confirm the version used?

I see this is related to #32 (comment). We're working on it and will provide a fix soon

@lucasassisrosa
Copy link
Contributor

@Dextario could you check this issue again on v2.0.0-beta.5?

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

No branches or pull requests

2 participants