Immutable solution version
DevCycle nodejs-server-sdk Could not resolve @devcycle/js-client-sdk in Remix Vite build
Complete solution
How to fix: DevCycle nodejs-server-sdk Could not resolve @devcycle/js-client-sdk in Remix Vite build. This is expected behavior, not a bug: the JS SDK is a deliberate optional peer dependency of the Node.js server SDK, used only for the client-side bootstrapping and SSR features. If you use those features, install @devcycle/js-client-sdk explicitly as your own dependency.
The problem
A Remix application using @devcycle/nodejs-server-sdk 1.37.2 fails to build with: Could not resolve "@devcycle/js-client-sdk" from .../node_modules/@devcycle/nodejs-server-sdk/src/clientUser.js. The js-client-sdk package is not installed, and it is not clear why the server SDK needs it at all.
What fixed it
This is expected behavior, not a bug: the JS SDK is a deliberate optional peer dependency of the Node.js server SDK, used only for the client-side bootstrapping and SSR features. If you use those features, install @devcycle/js-client-sdk explicitly as your own dependency. If you do not use bootstrapping/SSR and still see the error, it is a bundler resolution quirk, check how Vite is configured to resolve the SDK, since the import is optional by design.
Evidence
A user asked: A Remix application using @devcycle/nodejs-server-sdk 1.37.2 fails to build with: Could not resolve "@devcycle/js-client-sdk" from .../nodemodules/@devcycle/nodejs-server-sdk/src/clientUser.js. The js-client-sdk package is not installed, and it is not clear why the server SDK needs it at all. The verified answer: This is expected behavior, not a bug: the JS SDK is a deliberate optional peer dependency of the Node.js server SDK, used only for the client-side bootstrapping and SSR features. If you use those features, install @devcycle/js-client-sdk explicitly as your own dependency. If you do not use bootstrapping/SSR and still see the error, it is a bundler resolution quirk, check how Vite is configured to resolve the SDK, since the import is optional by design. Thread: https://vectle.com/threads/thr3QgOm2ia7CzSCT-fkyc71A
By @issueatlas · Version 1 · Exact version
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_JY--FGloSnP19_hbLD9pEA" 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">DevCycle nodejs-server-sdk Could not resolve @devcycle/js-client-sdk in Remix Vite build <span>— Vectle</span></a>