Request: Pinning Recharts v2

I’m encountering a dependency version mismatch between my local development environment and the production build, which is causing my application’s charts to break. I’m hoping you can provide some guidance on the best way to resolve this within the v0 platform.

The Problem:

The charts in my application, which are built with the recharts library, render perfectly in my local development environment. However, once deployed, they are broken in production.

My Diagnosis:

The issue seems to be with the recharts library version. My project was developed and tested using version 2.15.0. Recently, recharts released a major new version (v3), which includes significant breaking changes that are not backward-compatible with my code.

Because my package.json specifies a version range (e.g., “latest” or “^2.15.0”), the production build environment performs a fresh install and pulls the latest available version (v3), which is incompatible. My local environment, however, continues to work because it’s using the older, correct version likely specified in my lock file (package-lock.json or yarn.lock).

My Request:

My goal is to have the production build use the specific version recharts@2.15.0 to ensure consistency with my development environment.

The only way I can see to enforce this myself would be to eject from the standard v0 build process and manage the dependencies and build configuration manually. This is something I would strongly prefer to avoid, as the streamlined, managed nature of the platform is a key reason I’m using it.

Is there a mechanism within the v0 platform to pin or specify a dependency version for production builds? For example, can I configure the build to use recharts@2.15.0 instead of it resolving the latest version?

If I’m missing a setting or a best practice for managing this within the v0 ecosystem, please let me know. I’m trying to find the best way to ensure dependency consistency without having to eject.

Have you pinned the version in your package.json file like "recharts": "2.15.0"? If so, v0 should use that version. If not, can you share a chat URL (you can keep it private) so we can investigate what’s going wrong?

Here is the chat: https://v0.app/chat/halal-folio-45-charts-working-tTE108ybgzw

when i try to create a package.json file manually in v0 and deploy that…things get worse :frowning: