Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Infinite Loop on TOC Generation by index.md #14

Description

@sky-y

npx vivliostyle build --verbose goes infinity loop in this project when index.md is specified as TOC (<nav id="toc" role="doc-toc">).

toc on vivliostyle.config.js is disabled here.

Sample

sky-y/vivliostyle-issue-toc-error

To Reproduce

  • Clone the sample project
$ npm install
$ npx vivliostyle build --verbose

Expected behavior

npx vivliostyle build --verbose should generate PDF with TOC.

Desktop (please complete the following information):

  • OS: [e.g. iOS] macOS Catalina version 10.15.7
  • Browser [e.g. chrome, safari] 87.0.4280.88 (didn't use)
  • Version [e.g. 22]
$ npx vivliostyle --version
cli: 3.0.0-pre.4
core: 2.1.4

About this project

This project is originally generated by Create Book.

$ npm create book sample-book-kagakunofushigi
? description description
? author name アンリイ・ファブル(大杉栄、伊藤野枝訳)
? author email
? license CC0-1.0
? choose theme @vivliostyle/theme-techbook - Techbook (技術同人誌) theme
  • I renamed the generated directory to vivlistyle-issue-toc-error
  • Also I modified some settings and files for this issue.

Files

index.md:

# 科学の不思議

<nav id="toc" role="doc-toc">

## 目次

- [一 六人](./01.md)

</nav>

vivliostyle.config.js:

module.exports = {
  title: '科学の不思議', 
  author: 'アンリイ・ファブル(大杉栄、伊藤野枝訳)', 
  size: 'JIS-B5', // paper size.
  theme: '@vivliostyle/theme-techbook', // .css or local dir or npm package. default to undefined.
  entry: [
    'index.md',
    '01.md',
  ], 
  // toc: true, // whether generate and include toc.html or not (does not affect manifest.json), default to `true`. if `string` given, use it as a custom toc.html.
}

Log

$ npx vivliostyle build --verbose
ℹ MathJax(?): Cannot read property 'MmlTree' of undefined
ℹ defaultSettings {"pageSizeOption":"preset","pageSizePresetSelect":"JIS-B5","pageSizeUseLandscape":false,"pageSizeWidth":"210mm","pageSizeHeight":"297mm","overrideDocumentStylesheets":true,"loadMode":"book"}
ℹ JSHandle@object
ℹ E_INVALID_PROPERTY -o-tab-size: 4
ℹ Property not supported by the browser:  behavior
ℹ Property not supported by the browser:  ua-list-item-count
✔ index.md 科学の不思議
ℹ E_INVALID_PROPERTY -o-tab-size: 4
✔ 01.md 一 六人
ℹ Error during action: toc 
 TypeError: Cannot read property '1' of null 
 TypeError: Cannot read property '1' of null
    at e4 (http://localhost:13001/broker/dist/bundle.js:14697:61)
    at Array.map (<anonymous>)
    at t4 (http://localhost:13001/broker/dist/bundle.js:14694:33)
    at t3.e3.getTOC (http://localhost:13001/broker/dist/bundle.js:14699:16)
    at t3.e3.getTOC (http://localhost:13001/broker/dist/bundle.js:16101:100)
    at Array.listener (__puppeteer_evaluation_script__:8:39)
    at t3.e3.dispatchEvent (http://localhost:13001/broker/dist/bundle.js:1051:19)
    at t3.e3.dispatcher (http://localhost:13001/broker/dist/bundle.js:16056:30)
    at t3.e3.callback (http://localhost:13001/broker/dist/bundle.js:15676:38)
    at t3.callback (http://localhost:13001/broker/dist/bundle.js:15962:16)
        ---- async ---
        runCommand
        loop
        Frame.loop
        commandLoop

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions