Errors Compiling to Kindle (KF8/Mobi Ebook)

Hello, LL:
I’m getting this error trying to compile to KF8/Mobi Ebook.

If I switch to “Kindle Mobi Ebook” only (i.e. no KF8) it compiles fine.

Details from kindlegen:


Amazon kindlegen(MAC OSX) V2.9 build 1028-0897292
A command line e-book compiler
Copyright Amazon.com and its Affiliates 2014


Info(prcgen):I1047: Added metadata dc:Title [redacted]
Info(prcgen):I1047: Added metadata dc:Creator [redacted]
Info(prcgen):I1002: Parsing files 0000049
Warning(inputpreprocessor):W29004: Forcefully closed opened Tag:


in file: /private/var/folders/0_/mkz7qhvx2wd2jvvz1r5yvw4r0000gn/T/EBOOK_TEMP/NotE/body.xhtml line: 0000013
Info(prcgen):I1015: Building PRC file
Info(prcgen):I1006: Resolving hyperlinks
Info(prcgen):I1008: Resolving start reading location
Warning(prcgen):W30013: Invalid “nav” element in Navigation file. Please refer to Kindle Publishing Guidelines about usage of EPUB3 Navigation support. A “nav” element can have two child elements, an optional heading and a mandatory ol ordered list in file: /private/var/folders/0_/mkz7qhvx2wd2jvvz1r5yvw4r0000gn/T/EBOOK_TEMP/NotE/contents.xhtml line: 8
Error(prcgen):E24012: Epub Navigation file could not be built.
Info(prcgen):I1016: Building enhanced PRC file
Info(prcgen):I1007: Resolving mediaidlinks
Info(prcgen):I1011: Writing mediaidlinks
Info(prcgen):I1009: Resolving guide items
Info(prcgen):I1038: MOBI file could not be generated because of errors!

This is fixed for 3.0.2.

Thanks and all the best,
Keith

No, thank YOU. Scrivener has changed my writing life.

Thanks! That’s very kind to say!

Hi there,

I’ve got 3.0.2 installed and I’m getting pretty much the same error. I’ve used the “Copy Special to ToC” and that seems to be generating the problem - had no issues compiling prior to creating the ToC for kf8/mobi ebook.

Suggestions on how to get the ToC and a successful compile?

Warning(prcgen):W30013: Invalid "nav" element in Navigation file. Please refer to Kindle Publishing Guidelines about usage of EPUB3 Navigation support. A "nav" element can have two child elements, an optional heading and a mandatory ol ordered list  in file: /private/var/folders/t1/88cppy092vx5x_00h7c508t80000gn/T/EBOOK_TEMP/2018-05-21-novel-template-MAGIN/contents.xhtml line: 8

Thank you!
Evita

UPDATE:
Tried the fix here:
literatureandlatte.com/forum/vie … 93#p255893

No dice. still throwing the error.

Can you please attach a sample project showing the error by zipping up the project and using the “Attachments” tab beneath the reply text area?

Thank you for responding. I’ve uploaded a skeletal version of the file.

In the front matter section, there’s a file called “contents” for the ToC. There’s one link in it called “Translator’s Note”. If the link is there, I get the error below. If I delete the link, I can compile to kindle successfully.

I hope it’s just a matter of having improperly configured settings and that you’ll have an easy fix :slight_smile: Theres a high learning curve, but I’m loving Scrivener. Thanks for your help.

Eva

When the Contents file has the internal link to Translator’s Note, I get the error:
Info(prcgen):I1015: Building PRC file
Info(prcgen):I1006: Resolving hyperlinks
Info(prcgen):I1008: Resolving start reading location
Warning(prcgen):W30013: Invalid “nav” element in Navigation file. Please refer to Kindle Publishing Guidelines about usage of EPUB3 Navigation support. A “nav” element can have two child elements, an optional heading and a mandatory ol ordered list in file: /private/var/folders/t1/88cppy092vx5x_00h7c508t80000gn/T/EBOOK_TEMP/2018-05-22-sample-cant-compile-kindle-kf8-MAGIN/contents.xhtml line: 8
Error(prcgen):E24012: Epub Navigation file could not be built.
Info(prcgen):I1016: Building enhanced PRC file
Info(prcgen):I1007: Resolving mediaidlinks
Info(prcgen):I1011: Writing mediaidlinks
Info(prcgen):I1009: Resolving guide items
Info(prcgen):I1038: MOBI file could not be generated because of errors!

Thanks for the sample project. I’m afraid I cannot reproduce the error, though. I compiled your sample project and it threw no errors and opened in Kindle Previewer fine. I also tried compiling with the “Ebook” folder set as the front matter, but that worked fine, too, and opened in Kindle Previewer.

Is there anything else I need to do the error? Are you seeing the error in this skeletal version of the project yourself?

Thanks for the kind words!

All the best,
Keith

I had no issues with the compilation of this project as well, with or without the front matter folder added in. The table of contents is generated properly.

To make sure we’re using the same rough setup: are you using Scrivener in a language other than English? That might impact the creation of some internal files.

What I would also suggest is going into the general options tab in compile overview and enabling the Save source files in a folder with exported Kindle file setting. Upon compilation you will get a folder that contains all of the internal files used to create the Mobi. Of most interest to us would be the text of the contents.xhtml file, in the root level of that folder.

Thank you AmberV and KB for taking the time to look…

Hanging my head in a little shame at present…a true PEBKAC (problem exists between keyboard and chair) moment.

After seeing that neither of you had any problems with the compilation, I figured it had to be one of my settings. Sure enough, I hadn’t assigned a section type to the contents page. Once I assigned a “Table of Contents” section, voila. Like magic, it worked.

And now I have a beautiful book. I am so relieved and happy.

Thank you again for your help…hopefully someone else with this same error will see this thread and work it through a little more gracefully :wink:.

Cheers,
Eva

Glad to hear it was a simple fix! :slight_smile:

Glad you got it sorted! I’m still curious as to why I didn’t see this error in the sample project, though - had the contents page in that got some of the text removed, perhaps? I suspect the error was caused because of Epub’s very strict rules regarding tables of content, which are these:

  • The content links must all be contained in a list.
  • They must be surrounded by a block in the HTML.
  • The block can only contain content links and (optionally) a styled heading at the top. Anything else must be contained outside of the block.

Scrivener does its best to apply all this to the content you provide it - for instance, it finds the first link and places the HTML block either just before it or just before a heading if there was one directly before the link. However, depending on the content of the ToC document, Scrivener may not always be able to do this accurately, which is what I’m guessing may have been the case here.

All the best,
Keith

To be honest, I’m still confused as to why the error didn’t show on your end. I still can’t figure out exactly what I did that resolved it, either. I like to know what change I’m making that resolves an error so I know how to solve it the next time.

Right now, I’ve got all the ToC links showing and working great in the book, but in the Preview ToC, the introductory files (not front matter) before Part I aren’t showing.

I did create a new section type called Introduction and Forward, so I’m guessing I may not have set something up that would have them be handled correctly for the Preview ToC.

Also, there are 3 Parts, only Part I and Part II show in the Preview ToC link list (on the left in Preview). I’ve looked and re-looked. The section types are the same in Part III and in Parts I and II. I can’t see what’s triggering the difference in the way Part III is being handled.

When I looked at the xhtml file, there are

tags surrounding the links that do not show in the Preview ToC (Part III and the introductory files before Part I ToC links) .

After reading your latest response, I’m guessing that has something do with why they’re not showing - and is related to the structure. I am wading into figuring this out now…

Update: If I uncheck “Title” in the ToC Section Layout (in compile settings), then all files show up in the ToC in Preview (including ones I did not include in my manually created ToC file with “Copy documents as structured link list”.

For some reason, I’m guessing that I’m missing the setting that allows Scrivener to see that Part III and the Introduction and Forward files are “titles”…

Update #2: I understand ToC much better now…but am still struggling. will post a new thread elsewhere since I already hijacked this one. Essentially, when you automatically generate the HTML ToC, any section will be added to the ToC, There’s no way to create a page break between files. So I went back to trying to get a manual ToC to work, and am back to getting errors at compile. There may be a much better way to do achieve the outcome I’m looking for, but I haven’t figured it out yet.

again, thank you :slight_smile:
Eva

UPDATE: I realized this occurs if I nest files within folders. I moved front matter out of the front matter section and took them out of folders and this error resolved.

Am back…wondering again if you could you could point me in any directions?

I didn’t realize that even if the kindle didn’t compile that the source files would still be generated, so that’s why I didn’t post earlier.

Should each ToC link be prefaced with 1.?

If not, how do I fix?

I edit > copied special > structured list of links and pasted in the toc file. Here is the xhtml file for the toc:

[code]

Contents

1. CONTENTS 1. MAGIN: TIME To Tell This Story 1. Copyright 1. Credits 1. About The Editors
[/code]

Could you please attach (or send to mac.support AT literatureandlatte.com) the project exactly as it is with the problems, so that we can see the project in the state it is when you Compile and see these issues? Unfortunately, without seeing the project itself, it is difficult to know the cause, and we couldn’t reproduce it with the version of the project you sent previously.

There are clear errors in the HTML you have attached, which are related to the way Scrivener generates the HTML, but I need to see the project to find the cause, as I cannot reproduce any problems in Scrivener 3.0.2.

Thanks and all the best,
Keith

I have managed to find a bug whereby if a title is not included in the ToC, and you have a structured custom ToC, then there can be a validation error. I have fixed this (I hope) for the next update. This sounds like the first problem you were seeing, but I’m not sure it’s the same as the most recent once. Do you have a sample project you could upload?