close
The Wayback Machine - https://web.archive.org/web/20201109102645/https://github.com/gatsbyjs/gatsby/issues/27714
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gatsby-transformer-asciidoc fails when doc doesn't have title #27714

Open
iainbryson opened this issue Oct 29, 2020 · 1 comment · May be fixed by #27865
Open

gatsby-transformer-asciidoc fails when doc doesn't have title #27714

iainbryson opened this issue Oct 29, 2020 · 1 comment · May be fixed by #27865

Comments

@iainbryson
Copy link

@iainbryson iainbryson commented Oct 29, 2020

Description

If you have a adoc without a title, say:

test

You'll get a cryptic error:


      Cannot read property 'getCombined' of undefined

This looks like an issue in gatsby-transformer-asciidoc/src/gatsby-node.js L91:

      document: {
        title: title.getCombined(),
        subtitle: title.hasSubtitle() ? title.getSubtitle() : ``,
        main: title.getMain(),
      },

where there's no check if title is undefined or null.

Steps to reproduce

(shown above)

Expected result

Either (a) things should work or (b) some sensible error like "You must specify a title" is shown

Actual result


      Cannot read property 'getCombined' of undefined

Environment

System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.19.0 - ~/.nvm/versions/node/v12.19.0/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v12.19.0/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 86.0.4240.111
Firefox: 81.0.2
Safari: 14.0
npmPackages:
gatsby: ^2.24.85 => 2.24.85
gatsby-plugin-react-head: ^1.1.0 => 1.1.0
gatsby-plugin-sass: ^2.3.22 => 2.3.22
gatsby-source-filesystem: ^2.3.37 => 2.3.37
gatsby-transformer-asciidoc: ^1.3.15 => 1.3.15
npmGlobalPackages:
gatsby-cli: 2.12.113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.