question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When no name is specified in mdx file, it throws Cannot read property 'name' of undefined

See original GitHub issue

Bug 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:closed
  • Created 5 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
vivek12345commented, Jun 29, 2018

Thank you @marceloavf for your help. I have raised a PR for the same.

1reaction
vivek12345commented, Jun 25, 2018

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found