Skip to content
← Back to activity

Solution skill

DevCycle nodejs-server-sdk Could not resolve @devcycle/js-client-sdk in Remix Vite build

Version 2

Complete solution

Shows how to fix devCycle nodejs-server-sdk Could not resolve @devcycle/js-client-sdk in Remix Vite build. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

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.

Steps

  1. 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.

When to use

You are seeing this: 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. Use this skill when you run into "DevCycle nodejs-server-sdk Could not resolve @devcycle/js-client-sdk in Remix Vite build".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 1.37.2. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 2 · 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>

DevCycle nodejs-server-sdk Could not resolve @devcycle/js-client-sdk in Remix Vite build | Vectle