Repository: next.js
Issue: Local env variables are loaded with inlined comments
Labels: bug

### Link to the code that reproduces this issue

[Link](https://codesandbox.io/p/devbox/summer-snowflake-nlxq7z?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clq3k7ctq00063b6gha8t70qa%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clq3k7ctq00023b6gvmb3fu1q%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clq3k7ctq00043b6g8v70o21n%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clq3k7ctq00053b6gp37ap7fu%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B60%252C40%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clq3k7ctq00023b6gvmb3fu1q%2522%253A%257B%2522id%2522%253A%2522clq3k7ctq00023b6gvmb3fu1q%2522%252C%2522tabs%2522%253A%255B%255D%257D%252C%2522clq3k7ctq00053b6gp37ap7fu%2522%253A%257B%2522id%2522%253A%2522clq3k7ctq00053b6gp37ap7fu%2522%252C%2522activeTabId%2522%253A%2522clq3kdnut00rr3b6g6yd2ho8n%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A3000%252C%2522id%2522%253A%2522clq3kd3o600kk3b6g9wqowk2p%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%2522%257D%252C%257B%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A3000%252C%2522id%2522%253A%2522clq3kdnut00rr3b6g6yd2ho8n%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252F%2522%257D%255D%257D%252C%2522clq3k7ctq00043b6g8v70o21n%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clq3k7ctq00033b6gem61dlbs%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%255D%252C%2522id%2522%253A%2522clq3k7ctq00043b6g8v70o21n%2522%252C%2522activeTabId%2522%253A%2522clq3k7ctq00033b6gem61dlbs%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D)

### To Reproduce

1. In .env file define `NEXT_PUBLIC_SOMETHING` variable and add comment after it as `#some comment that should not be loaded`
2. Use the `NEXT_PUBLIC_SOMETHING` variable somewhere and log it.
3. Start the application and see that both the value and the comment are printed in the log. 

### Current vs. Expected behavior

Currently the dotenv loader loads everything after the `=` sign.
Expected behaviour would be that the loader only loads the value and not the comment.

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103
    Binaries:
      Node: 21.1.0
      npm: 10.2.0
      Yarn: 1.22.19
      pnpm: N/A
    Relevant Packages:
      next: 13.4.9
      eslint-config-next: 13.4.9
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A
```


### Which area(s) are affected? (Select all that apply)

Not sure

### Additional context

_No response_