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

Better dotenv error messages #4464

Merged
merged 6 commits into from
Apr 6, 2023
Merged

Better dotenv error messages #4464

merged 6 commits into from
Apr 6, 2023

Conversation

jridgewell
Copy link
Contributor

@jridgewell jridgewell commented Apr 4, 2023

The issue message emitted by TryDotenvProcessEnv was pretty bad: Execution of TryDotenvProcessEnv::read_all failed. This error message comes from #3550, which attaches the calling function as the context for every failed turbo function.

This PR accomplishes 2 main things:

  1. Expose an explicit method determining whether a the DotenvEnvProcess's prior or current env failed
  2. Detects a current env failure and uses the error's root cause for the issue message.

Screen Shot 2023-04-04 at 7 29 52 PM

Fixes WEB-851
Tests: vercel/next.js#47937

@jridgewell jridgewell requested a review from a team as a code owner April 4, 2023 23:26
@vercel
Copy link

vercel bot commented Apr 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web 🔄 Building (Inspect) Apr 6, 2023 4:19am
examples-nonmonorepo 🔄 Building (Inspect) Apr 6, 2023 4:19am
examples-vite-web 🔄 Building (Inspect) Apr 6, 2023 4:19am
turbo-site 🔄 Building (Inspect) Visit Preview Apr 6, 2023 4:19am
7 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-cra-web ⬜️ Ignored (Inspect) Apr 6, 2023 4:19am
examples-designsystem-docs ⬜️ Ignored (Inspect) Apr 6, 2023 4:19am
examples-gatsby-web ⬜️ Ignored (Inspect) Apr 6, 2023 4:19am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Apr 6, 2023 4:19am
examples-native-web ⬜️ Ignored (Inspect) Apr 6, 2023 4:19am
examples-svelte-web ⬜️ Ignored (Inspect) Apr 6, 2023 4:19am
examples-tailwind-web ⬜️ Ignored (Inspect) Apr 6, 2023 4:19am

@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

✅ This changes can build next-swc

@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

🟢 CI successful 🟢

Thanks

@jridgewell jridgewell requested a review from kwonoj April 5, 2023 18:09
@jridgewell jridgewell added the pr: automerge Kodiak will merge these automatically after checks pass label Apr 5, 2023
@padmaia padmaia enabled auto-merge (squash) April 5, 2023 21:21
crates/turbo-tasks-env/src/dotenv.rs Outdated Show resolved Hide resolved
crates/turbo-tasks-env/src/dotenv.rs Outdated Show resolved Hide resolved
crates/turbopack-env/src/try_env.rs Outdated Show resolved Hide resolved
Copy link
Contributor Author

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

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

Oh wow, I don't know why I didn't see the potential to split the methods. Done.

@jridgewell jridgewell requested a review from sokra April 5, 2023 23:21
@padmaia padmaia merged commit 8d32e8e into main Apr 6, 2023
@padmaia padmaia deleted the jrl-env-root-cause branch April 6, 2023 10:30
sokra added a commit to vercel/next.js that referenced this pull request Apr 6, 2023
### What?

Add a error message when using "use server".

* vercel/turborepo#4477 <!-- Tobias Koppers - add
ServerDirective transform which reports unsupported -->


### Why?

Turbopack doesn't support "use server" yet.

### Other turbopack updates

* vercel/turborepo#4464 <!-- Justin Ridgewell -
Better dotenv error messages -->
* vercel/turborepo#4485 <!-- Justin Ridgewell - Add
ServerAddr::hostname method -->
sokra added a commit to vercel/next.js that referenced this pull request Apr 6, 2023
### What?

Add a error message when using "use server".

* vercel/turborepo#4477 <!-- Tobias Koppers - add
ServerDirective transform which reports unsupported -->


### Why?

Turbopack doesn't support "use server" yet.

### Other turbopack updates

* vercel/turborepo#4464 <!-- Justin Ridgewell -
Better dotenv error messages -->
* vercel/turborepo#4485 <!-- Justin Ridgewell - Add
ServerAddr::hostname method -->
sokra added a commit to vercel/next.js that referenced this pull request Apr 6, 2023
### What?

Add a error message when using "use server".

* vercel/turborepo#4477 <!-- Tobias Koppers - add
ServerDirective transform which reports unsupported -->


### Why?

Turbopack doesn't support "use server" yet.

### Other turbopack updates

* vercel/turborepo#4464 <!-- Justin Ridgewell -
Better dotenv error messages -->
* vercel/turborepo#4485 <!-- Justin Ridgewell - Add
ServerAddr::hostname method -->
sokra added a commit to vercel/next.js that referenced this pull request Apr 6, 2023
### What?

Add a error message when using "use server".

* vercel/turborepo#4477 <!-- Tobias Koppers - add
ServerDirective transform which reports unsupported -->


### Why?

Turbopack doesn't support "use server" yet.

### Other turbopack updates

* vercel/turborepo#4464 <!-- Justin Ridgewell -
Better dotenv error messages -->
* vercel/turborepo#4485 <!-- Justin Ridgewell - Add
ServerAddr::hostname method -->
sokra added a commit to vercel/next.js that referenced this pull request Apr 6, 2023
### What?

Add a error message when using "use server".

* vercel/turborepo#4477 <!-- Tobias Koppers - add
ServerDirective transform which reports unsupported -->


### Why?

Turbopack doesn't support "use server" yet.

### Other turbopack updates

* vercel/turborepo#4464 <!-- Justin Ridgewell -
Better dotenv error messages -->
* vercel/turborepo#4485 <!-- Justin Ridgewell - Add
ServerAddr::hostname method -->
sokra added a commit to vercel/next.js that referenced this pull request Apr 6, 2023
### What?

Add a error message when using "use server".

* vercel/turborepo#4477 <!-- Tobias Koppers - add
ServerDirective transform which reports unsupported -->


### Why?

Turbopack doesn't support "use server" yet.

### Other turbopack updates

* vercel/turborepo#4464 <!-- Justin Ridgewell -
Better dotenv error messages -->
* vercel/turborepo#4485 <!-- Justin Ridgewell - Add
ServerAddr::hostname method -->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
The issue message emitted by `TryDotenvProcessEnv` was pretty bad:
`Execution of TryDotenvProcessEnv::read_all failed`. This error message
comes from #3550, which attaches the calling function as the context for
every failed turbo function.

This PR accomplishes 2 main things:
1. Expose an explicit method determining whether a the
`DotenvEnvProcess`'s prior or current env failed
2. Detects a current env failure and uses the error's root cause for the
issue message.

<img width="961" alt="Screen Shot 2023-04-04 at 7 29 52 PM"
src="https://user-images.githubusercontent.com/112982/229944525-d39dbe87-778a-4421-9bc8-632924cd3782.png">


Fixes WEB-851
Tests: #47937
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
The issue message emitted by `TryDotenvProcessEnv` was pretty bad:
`Execution of TryDotenvProcessEnv::read_all failed`. This error message
comes from #3550, which attaches the calling function as the context for
every failed turbo function.

This PR accomplishes 2 main things:
1. Expose an explicit method determining whether a the
`DotenvEnvProcess`'s prior or current env failed
2. Detects a current env failure and uses the error's root cause for the
issue message.

<img width="961" alt="Screen Shot 2023-04-04 at 7 29 52 PM"
src="https://user-images.githubusercontent.com/112982/229944525-d39dbe87-778a-4421-9bc8-632924cd3782.png">


Fixes WEB-851
Tests: #47937
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
The issue message emitted by `TryDotenvProcessEnv` was pretty bad:
`Execution of TryDotenvProcessEnv::read_all failed`. This error message
comes from #3550, which attaches the calling function as the context for
every failed turbo function.

This PR accomplishes 2 main things:
1. Expose an explicit method determining whether a the
`DotenvEnvProcess`'s prior or current env failed
2. Detects a current env failure and uses the error's root cause for the
issue message.

<img width="961" alt="Screen Shot 2023-04-04 at 7 29 52 PM"
src="https://user-images.githubusercontent.com/112982/229944525-d39dbe87-778a-4421-9bc8-632924cd3782.png">


Fixes WEB-851
Tests: #47937
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants