When no name is specified in mdx file, it throws Cannot read property 'name' of undefined
See original GitHub issueBug Report
To Reproduce
Create an MDX file with no name specified. It will generate the error:
$ docz dev
TypeError: Cannot read property 'name' of undefined
at new Entry (.../frontend/node_modules/docz-core/dist/index.js:1:5189)
at Promise.all.s.filter.map (.../frontend/node_modules/docz-core/dist/index.js:1:7654)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:746:11)
at startup (internal/bootstrap/node.js:238:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)
Expected behavior
Provide a helpful error message that $path/to/file.mdx does not contain a name.
It probably occurs at this line but couldn’t find out how to run docz without using the dist
version to validate:
https://github.com/pedronauck/docz/blob/master/packages/docz-core/src/Entry.ts#L98
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
React Error TypeError: Cannot read property 'name' of undefined
I am learning to react but I am stuck in one issue. I am trying to get the array properties in ...
Read more >Troubleshooting MDX
This article goes through several common problems and errors that might occur when using MDX.
Read more >cannot read properties of undefined (reading 'title') - You.com
Your issue is that your .find() method is returning undefined , so you can't access properties on product such as .name as it...
Read more >General Error Messages | InterSystems Error Reference
... name is invalid. 43, the write daemon failed to set the READ/WRITE flag in label ... 66, the resource name in the...
Read more >How to Build Your Own Blog with Next.js and MDX
MDX brings this flexibility into a markdown file by allowing you to literally write or import JavaScript (React) components into your articles.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @marceloavf for your help. I have raised a PR for the same.
@pedronauck I would like to take this up.The solution I am thinking here is throwing an error with the message of $path/to/file.mdx does not contain a name.