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

L-1016 By default, don't check ENV vars in Vercel non-production build #15

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

PetrHeinz
Copy link
Member

Resolves #6 when building project via vercel build while not having VERCEL_ENV variable accessible during build.

Copy link
Contributor

@curusarn curusarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you test this by running vercel build to make sure we don't show the warnings? 🙏

@PetrHeinz
Copy link
Member Author

PetrHeinz commented Nov 24, 2023

@curusarn That's what I did even before #14, worked as intended with example project on my machine. There's just too many variables to ensure others will have the same experience...

Here's full output for possible use in the future:

Petrs-MacBook-Pro:logger petrheinz$ vercel build
Vercel CLI 32.5.6
WARNING: You should not upload the `.next` directory.
Installing dependencies...

up to date in 1s

124 packages are looking for funding
  run `npm fund` for details
Detected Next.js version: 14.0.2
Detected `package-lock.json` generated by npm 7+
Running "npm run build"

> build
> next build

 ✓ Linting and checking validity of types    
   ▲ Next.js 14.0.2

 ⚠ /api/edge provided runtime 'experimental-edge'. It can be updated to 'edge' instead.
 ✓ Creating an optimized production build    
 ✓ Compiled successfully
 ⚠ You are using an experimental edge runtime, the API might change.
 ✓ Collecting page data    
 ✓ Generating static pages (3/3) 
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

Route (pages)                              Size     First Load JS
┌ ● /                                      4.92 kB        91.5 kB
├   /_app                                  0 B            86.5 kB
├ ○ /404                                   182 B          86.7 kB
├ ℇ /api/edge                              0 B            86.5 kB
├ λ /api/hello                             0 B            86.5 kB
└ λ /serverSideProps                       407 B          86.9 kB
+ First Load JS shared by all              86.5 kB
  ├ chunks/framework-66d32731bdd20e83.js   45.2 kB
  ├ chunks/main-8c2fcf961f1eeec3.js        31.8 kB
  ├ chunks/pages/_app-9cf4ffac8ca82c92.js  8.75 kB
  └ chunks/webpack-59c5c889f52620d6.js     819 B

ƒ Middleware                               36.8 kB

○  (Static)        prerendered as static content
●  (SSG)           prerendered as static HTML (uses getStaticProps)
λ  (Dynamic)       server-rendered on demand using Node.js
ℇ  (Edge Runtime)  server-rendered on demand using the Edge Runtime

Traced Next.js server files in: 237.505ms
Created all serverless functions in: 95.793ms
Collected static files (public/, static/, .next/static): 1.594ms
✅  Build Completed in .vercel/output [7s]

@PetrHeinz
Copy link
Member Author

PetrHeinz commented Nov 24, 2023

@curusarn I hope @jakeleventhal will verify that it works in their use case as well, so we know we're in the clear before releasing another small fix 🙂

⏳ I'm waiting with merging it for the time being...

@jakeleventhal
Copy link

@PetrHeinz #6 (comment)

@PetrHeinz PetrHeinz merged commit 784603f into main Nov 28, 2023
14 checks passed
@PetrHeinz PetrHeinz deleted the ph/check-env-vars branch November 28, 2023 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to hide build warnings for local development
3 participants