Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Environment variables exceed Vercel limit #67

Open
stevenmqnguyen opened this issue Jan 22, 2022 · 2 comments
Open

[Bug] Environment variables exceed Vercel limit #67

stevenmqnguyen opened this issue Jan 22, 2022 · 2 comments
Assignees
Labels
Bug Report Something isn't working

Comments

@stevenmqnguyen
Copy link
Member

Describe the bug
The combined size of environment variables for Portal v1 and portal v2 exceed the 4KB limit imposed by Vercel for a single project.
Vercel environment variable limits

To Reproduce
Steps to reproduce the behavior:

  1. Redeploy preview branch
  2. See error

Expected behavior
Vercel deploys preview branches on commit.

Additional context
Possible solutions:

  • Move the next branch to a new repo and set up another Vercel project. This also fixes the issue of Build & Development setting not being compatible with CRA and NextJS
  • Vercel 4KB workaround Since we use Doppler, we would need to use doppler webhooks and some automation to encrypt secrets and commit to repo? Seems unnecessary and complicated compared to the other option with some other consequences.
@stevenmqnguyen stevenmqnguyen added the Bug Report Something isn't working label Jan 22, 2022
@WillieCubed
Copy link
Contributor

From what I saw with the Vercel deployment, the Build & Deployment setting was properly configured to run npm run build and use "build" as the directory to deploy. However, the environment variable size limit is much more cumbersome to resolve. As a temporary workaround, I've created a temporary portal-next repo that will exist until Portal v2 becomes ready for migration.

To preserve Git history, the repo will be initialized using the existing portal repo, but its primary branch will be the next branch. For purposes of pre-release development, the next branch should be considered the default development branch, and new features should be built by branching off them. Existing contributors can add the other repository as a remote and use that as the base for development:

git remote add origin-v2 [email protected]:acmutd/portal-next.git
git branch next --set-upstream-to origin-v2/next

Alternatively, this other repo can be separately cloned, but it will still maintain the Git history of Portal v1 repo in addition to the next branch changes.

When the migration occurs, the next branch will be rebased onto the dev branch, and the Vercel deployment will be updated accordingly to test. When Portal v1 is fully deprecated and shut down, Portal v2 will become the production deployment, and the Vercel deployment will be updated accordingly.

@stevenmqnguyen
Copy link
Member Author

There is seemingly something different that choosing the NextJS Build & Deployment setting does that we didn't account for with the Other setting even with the same build commands. You can test this out by changing the setting to other and redeploying the next previews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants