Import several notes (with images) error

Bug report

Hello!
This is my first post here.
I am trying to import several notes from notion (export from there as .md notes with correspondent attachments - images).
Some notes are imported but more than 200 not!
This is the error.
There are something that I can do?

An unexpected error happened while processing "/Users/thiagonce/Downloads/971913be-5b1a-4cc5-9f01-cf0635e0e1a0_Export-1ab5c460-d506-4fed-a67f-ad1d6715a429/LLinks 566c8ad526ea475bbe0c3ac17dd2835d/Extracting Twitter Data, Pre-Processing and Sentim c6895438799949f897e3740b8b75352b.md".

ReferenceError: DEFAULT_TRUNCATE_STRING_BINARY_SIZE is not defined
    at truncateToBinarySize (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/inkdrop-import-utils/truncate-to-binary-size.js:30:21)
    at getTitleAndBodyFromMarkdown (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/inkdrop-import-utils/index.js:37:15)
    at importMarkdownFromFile (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/import-markdown/lib/importer.js:151:27)
    at importMarkdownFromMultipleFiles (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/import-markdown/lib/importer.js:116:11)
    at importMarkdownFromMultipleFilesAndDirectories (/Applications/Inkdrop.app/Contents/Resources/app.asar/node_modules/import-markdown/lib/importer.js:109:13)
    at index.js:42:11

Environment

  • Platform: macOS
  • Platform version: Ventura 13.3
  • App Version: 5.5.3

How to reproduce

I export several notes from notion (some with imagens) and just use de import menu.

Hi Thiago,

Thanks for the report.
I found that that happens when importing notes with a title longer than 128 characters.
Can you please try making those filenames shorter?
Sorry for the trouble. I’ll fix it in the next release!

Hi Takuya,

I made a small script (in python) to count the length of all filenames.
None of then are 128 characters long.

import glob

arquivos = glob.glob("*")

for arquivo in arquivos:
    nome = arquivo.split(".")
    novo = nome[0][:100] + ".md"
    if len(arquivo) >= 128:
        print(f"{arquivo} [{len(arquivo)}] / {novo} [{len(novo)}]")

thank you for your help.

The error happens at this line:

The importer seeks the first line that begins with a # heading and then uses it as its note title.
If it is longer than 128, it tries to truncate but it has a bug as you reported.

Can you please look check md files and see if they have long h1 headings?

NOTE: The module has been fixed, so it will be working fine in the next release.

1 Like