ref(nextjs): Make isBuild rely on NEXT_PHASE environment variable#5829
ref(nextjs): Make isBuild rely on NEXT_PHASE environment variable#5829
isBuild rely on NEXT_PHASE environment variable#5829Conversation
|
This works... almost. The reason I didn't use That said, it seems like it's defined in all but the first |
|
Ah thanks for showing me this. In my tests I only put console logs for
It's probably fine the way it is right now. :D |
|
Some more thoughts: It appears that the first invocation of |
No - we only inject into page files. Stick a debugger statement in right after we modify the The reason it's running early isn't about initializing the SDK, it's about config. Here's the sequence of events:
So, OTOH, if we end up deep-sixing
This is probably true but a separate question, IMHO. But if we feel like it, we certainly could make |

Potentially (?) makes the
isBuildutility method for our Next.js SDK more reliable, by looking at theNEXT_PHASEenvironment variable which is set by Next.js.