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

Error [ERR_REQUIRE_ESM]: require() node_modules/wait-for-async/lib/index.js not supported. #4

Open
kholiavko-roman opened this issue Dec 24, 2024 · 0 comments

Comments

@kholiavko-roman
Copy link

While starting the project in production mode, I receive an error

> node dist/index.js

/project/node_modules/ringcentral-softphone/dist/src/softphone.js:17
const wait_for_async_1 = __importDefault(require("wait-for-async"));
                                         ^

Error [ERR_REQUIRE_ESM]: require() of ES Modul /project/node_modules/wait-for-async/lib/index.js from /project/node_modules/ringcentral-softphone/dist/src/softphone.js not supported.
Instead change the require of index.js in /project/node_modules/ringcentral-softphone/dist/src/softphone.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/project/node_modules/ringcentral-softphone/dist/src/softphone.js:17:42) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.17.0
npm error Lifecycle script `start` failed with error:
npm error code 1

A few days ago the package wait-for-async introduced a significant change, where it was moved to ES modules
tylerlong/wait-for-async@3c4cdd4#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R7
but ringcentral-softphone-ts package are commonJS module.

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

1 participant