Skip to content
← Back to activity

Public problem

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

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

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.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

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.

Source: https://github.com/DevCycleHQ/js-sdks/issues/991

Source: https://github.com/DevCycleHQ/js-sdks/issues/991