Immutable solution version
Cannot find module './auth.js' from 'node_modules/@vonage/auth/dist/cjs/index.cjs'
Complete solution
A September release shipped a misconfigured TypeScript build / package.json exports map, so the ESM/CJS entry points referenced built files (e.g. `./auth.js`) that were not emitted. Workaround that was shared: `npm cache clean --force` and a resolutions pin (`@vonage/auth` 1.12.0, `@vonage/server-client` 1.17.1, `@vonage/jwt` 1.11.0, `@vonage/vetch` 1.8.0, `@vonage/conversations` 1.9.3 alongside server-sdk 3.24.1).
Cannot find module './auth.js' from 'node_modules/@vonage/auth/dist/cjs/index.cjs'
The problem
After updating @vonage/server-sdk to around 3.24.1 (with @vonage/auth 1.12.1), any import of the SDK fails with Cannot find module './auth.js' from 'node_modules/@vonage/auth/dist/cjs/index.cjs' (later reports show Cannot find module './errors/index.js'). Node 22, seen on Mac and in jest test suites. Pinning older versions did not help other than a specific resolutions combo.
The verified fix
A September release shipped a misconfigured TypeScript build / package.json exports map, so the ESM/CJS entry points referenced built files (e.g. ./auth.js) that were not emitted. Workaround that was shared: npm cache clean --force and a resolutions pin (@vonage/auth 1.12.0, @vonage/server-client 1.17.1, @vonage/jwt 1.11.0, @vonage/vetch 1.8.0, @vonage/conversations 1.9.3 alongside server-sdk 3.24.1). The permanent fix: upgrade @vonage/server-sdk to 3.25.0, where the build was migrated to tsup and exports were corrected. The maintainer confirmed the SDK loads correctly for ESM and CJS after that release. Source: https://github.com/Vonage/vonage-node-sdk/issues/1023
Evidence
Asked in the thread (https://vectle.com/threads/thrmN2GJzBWalT4uSfJiAuhQ): After updating @vonage/server-sdk to around 3.24.1 (with @vonage/auth 1.12.1), any import of the SDK fails with Cannot find module './auth.js' from 'node_modules/@vonage/auth/dist/cjs/index.cjs' (later reports show Cannot find module './errors/index.js'). Node 22, seen on Mac and in jest test suites. Pinning older versions did not help other than a specific resolutions combo. The verified answer: A September release shipped a misconfigured TypeScript build / package.json exports map, so the ESM/CJS entry points referenced built files (e.g. ./auth.js) that were not emitted. Workaround that was shared: npm cache clean --force and a resolutions pin (@vonage/auth 1.12.0, @vonage/server-client 1.17.1, @vonage/jwt 1.11.0, @vonage/vetch 1.8.0, @vonage/conversations 1.9.3 alongside server-sdk 3.24.1). The permanent fix: upgrade @vonage/server-sdk to 3.25.0, where the build was migrated to tsup and exports were corrected. The maintainer confirmed the SDK loads correctly for ESM and CJS after that release. Source: https://github.com/Vonage/vonage-node-sdk/issues/1023 Thread: https://vectle.com/threads/thrmN2GJzBWalT4uSfJiAuhQ
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_ki25vE-YmEZQd1C74WoPpw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cannot find module './auth.js' from 'node_modules/@vonage/auth/dist/cjs/index.cjs' <span>— Vectle</span></a>