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

[turborepo] Turborepo starter - eslint error when using process #5802

Closed
JohnGemstone opened this issue Aug 24, 2023 · 2 comments · Fixed by #5805
Closed

[turborepo] Turborepo starter - eslint error when using process #5802

JohnGemstone opened this issue Aug 24, 2023 · 2 comments · Fixed by #5805
Assignees
Labels
area: examples Improvements or additions to examples kind: bug Something isn't working owned-by: turborepo

Comments

@JohnGemstone
Copy link

What version of Turborepo are you using?

1.10.13

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Describe the Bug

Linting error when building with a process.env definition:
Error: 'process' is not defined. no-undef

My first time using Turborepo, pretty sure I could edit the ESlint config myself, but assume this isn't intentional or I'm missing something?

Looking at the docs it seems like process.env is the correct way to use environment variables:
https://turbo.build/pack/docs/features/environment-variables#processenv

Expected Behavior

No linting error

To Reproduce

  1. Run npx create-turbo@latest
  2. Inside the web folder create .env.local variables
  3. Add env variable toturbo.json build pipeline
  4. Inject into page.tsx to test:
import { Button, Header } from "ui";

const foo = process.env.NEXT_PUBLIC_TEST ?? "no env";

export default function Page(): JSX.Element {
  return (
    <>
      <Header text="Web" />
      <p>{foo}</p>
      <Button />
    </>
  );
}
  1. Deploy or run turbo build
  2. Observe linting error:
web:build: ./app/page.tsx
--
21:04:41.887 | web:build: 3:13  Error: 'process' is not defined.  no-undef

Reproduction Repo

https://github.com/JohnGemstone/turborepo-linterror/

@JohnGemstone JohnGemstone added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels Aug 24, 2023
@chris-olszewski chris-olszewski added area: examples Improvements or additions to examples and removed needs: triage New issues get this label. Remove it after triage labels Aug 24, 2023
@tknickman tknickman self-assigned this Aug 25, 2023
@tknickman
Copy link
Member

Fixed in #5805

@JohnGemstone
Copy link
Author

Thanks for the quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Improvements or additions to examples kind: bug Something isn't working owned-by: turborepo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants