Navigation Menu

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

Infinite Loop on TOC Generation by index.md #14

Open
sky-y opened this issue Dec 24, 2020 · 0 comments
Open

Infinite Loop on TOC Generation by index.md #14

sky-y opened this issue Dec 24, 2020 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sky-y
Copy link

sky-y commented Dec 24, 2020

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
@akabekobeko akabekobeko self-assigned this Mar 28, 2021
@akabekobeko akabekobeko added the bug Something isn't working label Mar 28, 2021
@akabekobeko akabekobeko added this to the 1.0.0 milestone Jul 5, 2021
@akabekobeko akabekobeko modified the milestones: 1.0.0, v1.1.0 Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants