 Prevent NEXT_PHASE env change in workers (#28941)
 Prevent NEXT_PHASE env change in workers (#28941)

`process.env.NEXT_PHASE` was moved in https://github.com/vercel/next.js/pull/20900 to be set during `staticCheckSpan.traceAsyncFn`. I believe this to be a mistake, the NEXT_PHASE should be set earlier in the code execution.

On a personal note, this impacts an application I am developing where we rely on the environment variable `NEXT_PHASE` to be set but is `undefined` when we check it.

Co-authored-by: JJ Kasper <7323a5431d1c31072983a6a5bf23745b655ddf59@jjsweb.site>
JeromeFitz/next.js,zeit/next.js,azukaru/next.js,JeromeFitz/next.js,azukaru/next.js,azukaru/next.js,zeit/next.js,zeit/next.js,JeromeFitz/next.js,azukaru/next.js,JeromeFitz/next.js