Skip to content

Cannot destructure property 'components' of 'object null' as it is null #37924

Answered by roofleDev
roofleDev asked this question in Help
Discussion options

You must be logged in to vote

I got this figured out. I was accessing an environment variable in _app.tsx. If the variable was not found, it was calling throw "!apiKey".

Unfortunately the usage of just throw resulted in _app.tsx swallowing the error and reporting the destructuring error instead. Amazingly, if I change it to throw new Error("!apiKey") it's extremely easy to debug. Oy vey.

Additionally my other environments were correctly configured, adding to the mystery. Also my localhost seems to have ran for many weeks before this was triggered, also adding to the mystery.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by roofleDev
Comment options

You must be logged in to vote
2 replies
@kylekirkby
Comment options

@riya-microlent
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants