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

TypeError: Cannot read property 'text' of undefined #135

Closed
MarcoHengstenberg opened this issue Apr 22, 2014 · 9 comments
Closed

TypeError: Cannot read property 'text' of undefined #135

MarcoHengstenberg opened this issue Apr 22, 2014 · 9 comments

Comments

@MarcoHengstenberg
Copy link

I have no idea what to make out of this error message.

I have installed Gitbook a few weeks ago and have recently started to create a book. Now, all out of a sudden, it refrains from doing the gitbook serve task by telling me "TypeError: Cannot read property 'text' of undefined".

I just did the npm install gitbook -g command again to get the current version of Gitbook. Now, when doing the gitbook serve task the following output is given:

Starting build ...
TypeError: Cannot read property 'text' of undefined
at parseChapter (/usr/local/lib/node_modules/gitbook/lib/parse/summary.js:94:46)
at Function.map (/usr/local/lib/node_modules/gitbook/node_modules/lodash/dist/lodash.js:3508:27)
at lodash.ctor.(anonymous function) as map
at Object.parseSummary as summary
at /usr/local/lib/node_modules/gitbook/lib/generate/index.js:125:45
at _fulfilled (/usr/local/lib/node_modules/gitbook/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/gitbook/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/gitbook/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/gitbook/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/gitbook/node_modules/q/q.js:108:17)

@SamyPesse
Copy link
Member

Can you give me the content of your SUMMARY.md please

@MarcoHengstenberg
Copy link
Author

# Summary

- [The Setup](the-setup/README.md)
  - [Dependencies](the-setup/dependencies.md)
  - [The Installation](the-setup/the-installation.md)

- [The Project](the-project/README.md)
  - [Project Files](the-project/project-files.md)
  - [About The Project](the-project/project-theme.md)

@SamyPesse
Copy link
Member

Can you try removing the line between the two lists and let me know if that works?

@AaronO do you have any idea why this error is happing?

@MarcoHengstenberg
Copy link
Author

The empty line was the problem indeed.
Why is that?

However, issue closed and a huge thanks! =)

@SamyPesse
Copy link
Member

The empty line was creating two list in the summary and not just one, it should not raised an error but just ignore the second list.

@AaronO wrote this code, so I'll just let him take a look at this.

@iredmail
Copy link

It turns out this is the most common issue while building book, please help fix it ASAP.

@SamyPesse
Copy link
Member

Did you look at the solution below ?

@jicksta
Copy link

jicksta commented Jan 10, 2015

I ran into this as well. Was kinda surprised it was just a formatting issue. Some warning would be nice. This is an error that many folks who are wanting to try gitbook will bump into literally on their first execution of the gitbook command. Thanks for the work on gitbook btw!

@oubiwann
Copy link

This one just bit me as well. Couldn't figure out why the new book wasn't building. This is my third gitbook, and I wanted to try a deeper content structure ...

Nyar233 pushed a commit to Nyar233/gitbook that referenced this issue May 12, 2024
* fix tab multiline

* OpenAPI improvements (GitbookIO#127)

* Fix display of authentication infos

* Fix property names

* Fix body / request starting with oneOf

* CSS fixes

* Show description

* Format

* Fix code samples

* Convert swagger 2.0 to OpenAPI v3 (GitbookIO#128)

* Convert swagger 2.0 to OpenAPI 3

* Format

* Fix page with one api block shown as empty (GitbookIO#129)

* Fix page with one api block shown as empty

* Format

* Style sprint (GitbookIO#126)

* V1 code blocks fix

* equalize modal text label + fix safari bug with fixed position stroke

* code block adjustments

* fix search result spacing

* remove metal + adjust light and dark mode

* remove metal from tw config

* Add colordebugger + remove unused global colors

* correct opacities on all colors

* first part of cleaning up colors

* fix tab colors

* search modal color changes

* adjust global colors

* expandable + code color changes

* add delay to loading panes

* adjust globals

* improve select table type

* improve light mode checkbox

* fix delay

* content

* uncomment debug

* expandable fixes

* OpenAPI improvements (GitbookIO#127)

* Fix display of authentication infos

* Fix property names

* Fix body / request starting with oneOf

* CSS fixes

* Show description

* Format

* Fix code samples

* Fix empty API responses not being displayed (GitbookIO#130)

* Fix response not being displayed when contains no body

* Fix padding

* Resolve any JSON/YAML OpenAPI file and resolve common parameters (GitbookIO#132)

* Fix parsing of OpenAPI when content-type is unknown

* Resolve common parameters

* Format

* Add support for straight corners (GitbookIO#131)

* Add class to body and tailwind variant

* Use it on the search button

* Use it for buttons and cookies banner

* Use it for cards

* Use it in more places

* Lint

* More

* page feedback

* theme toggler

* Rename Authentication to Authorization (GitbookIO#133)

* remove unused color light-5

* fix dupe css

---------

Co-authored-by: Samy Pessé <samypesse@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants