You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an "unexpected error" while running the upgrade-legacy codemod, at the update imports in the _document file step: TypeError: Cannot read property 'name' of null
I dug into the code and managed to identify the reason for that error.
See l.941:
We are looking for the opening element for DocumentHead
In my case, DocumentHead was empty, and was written as a self-closing tag: <DocumentHead /> , thus making it invisible for this query, since we are looking for a node with an openingElement with a name of DocumentHead.
Changing <DocumentHead /> to <DocumentHead><DocumentHead/> has fixed the issue.
Paste all your error logs here:
✖ update imports in the _document file
TypeError: Cannot read property 'name' of null
This is an unexpected error. Please ask for help in the discord #general-help channel. https://discord.blitzjs.com
What is the problem?
I ran into an "unexpected error" while running the
upgrade-legacy
codemod, at theupdate imports in the _document file
step:TypeError: Cannot read property 'name' of null
I dug into the code and managed to identify the reason for that error.
See l.941:
blitz/packages/codemod/src/upgrade-legacy.ts
Line 941 in 922bc27
We are looking for the opening element for
DocumentHead
In my case,
DocumentHead
was empty, and was written as a self-closing tag:<DocumentHead />
, thus making it invisible for this query, since we are looking for a node with anopeningElement
with a name of DocumentHead.Changing
<DocumentHead />
to<DocumentHead><DocumentHead/>
has fixed the issue.Paste all your error logs here:
Paste all relevant code snippets here:
_document.tsx
What are detailed steps to reproduce this?
DocumentHead
tag in_document.tsx
npx @blitzjs/codemod upgrade-legacy
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response
The text was updated successfully, but these errors were encountered: