-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I get the following error whenever I try to download stories with the npm package version of fimfic2epub. This is using the latest version of both fimfic2epub and Node.js, (those being v1.7.58 and v24.0.1 respectively, as of May 11th 2025.) and with all settings at default. (i.e., no arguments outside of the story URL) The operating system I'm using is Windows 11, version 24H2.
Fetching metadata...
Fetching chapters...
Fetching cover image...
Calculating Flesch reading ease...
TypeError: Cannot read properties of undefined (reading 'toLocaleString')
at {REDACTED FOR PRIVACY}\npm\node_modules\fimfic2epub\dist\fimfic2epub.js:1027:263
at Array.map (<anonymous>)
at Module.createNav ({REDACTED FOR PRIVACY}\npm\node_modules\fimfic2epub\dist\fimfic2epub.js:1027:45)
at FimFic2Epub.buildPages ({REDACTED FOR PRIVACY}\npm\node_modules\fimfic2epub\dist\fimfic2epub.js:2357:69)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
I've tracked the error to two spots in line 1027 of fimfic2epub.js, which I've included below. (Those spots being right before map and right before `toLocaleString')
const prettyList = ffc.storyInfo.chapters.map((ch, num) => mithril__WEBPACK_IMPORTED_MODULE_0___default()('li.item', [mithril__WEBPACK_IMPORTED_MODULE_0___default()('.floatbox', mithril__WEBPACK_IMPORTED_MODULE_0___default()('span.wordcount', ch.realWordCount.toLocaleString('en-GB'))), mithril__WEBPACK_IMPORTED_MODULE_0___default()('a', {
Unfortunately I haven't been able to figure out what specificly is going wrong due to not actually know Javascript myself, but my best guess is that mithril__WEBPACK_IMPORTED_MODULE_0___default can't take toLocaleString as an argument, since from what I've found 'en-GB' is a valid argument for toLocalString
It's probably worth mentioning that the Firefox addon still works just fine for me, it's specifically the npm package that's crashing.
Please let me know if there's any more information you need, or anything else I could do to help. I tried to include everything relevant but this is the first time I've written a Github issue like this.