graphlab-fr / cosma

Cosma is a document graph visualization tool. It modelizes interlinked Markdown files and renders them as an interactive network in a web interface.
https://cosma.arthurperret.fr
GNU General Public License v3.0
128 stars 4 forks source link

[Enhancement] More explanatory errors #152

Open carsanbu opened 5 days ago

carsanbu commented 5 days ago

Which part of Cosma is your request about?

Describe your request:

Recently I discover Cosma and tried to use in my Markdown Zettelkasten. After follow the tutorial and configure my card's directory I run this command: cosma modelize --project cosma-test

But the result is this:

[...].options.objname?i.push(t):i[t[0]]=t[1]},s=()=>{},o=n.parse(t,!1,r,s);if(void 0!==o)throw o;const a=n.parse(void 0,!0,r,s);if(void 0!==a)throw a;return i}(r,{columns:!0,skip_empty_lines:!0}).map((t=>Er.getFormatedDataFromCsvLine(t)))}catch(t){return console.error(["","Err.",""].join(""),"CSV data file is invalid.")}break;default:return console.error(["","Err.",""].join(""),"Data file format unrecognized. Supported file extensions: .json, .csv.")}const{files_origin:s}=i.opts,o=La.getIndexToMassSave(s)+1;Er.massSave(r,o,i.opts,e).then((()=>console.log(["","Records created",""].join(""),`(${r.length})`,["",s,""].join("")))).catch((t=>console.error(["","Err.",""].join(""),t)))}))}(t,i)})).showHelpAfterError('("batch --help" for additional information)'),th.showSuggestionAfterError(),th.parse()})()})();

TypeError: Cannot read properties of undefined (reading 'match')
    at N.getWikiLinksFromFileContent (/usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:706267)
    at Ia.getRecordsFromFiles (/usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:894107)
    at Zu (/usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:1272097)
    at m.<anonymous> (/usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:1278494)
    at m._actionHandler (/usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:544448)
    at /usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:553761
    at m._chainOrCall (/usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:552336)
    at m._parseCommand (/usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:553736)
    at /usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:551121
    at m._chainOrCall (/usr/local/lib/node_modules/@graphlab-fr/cosma/dist/back.cjs:3:552336)

Node.js v19.1.0

I can't tell in which file is failing and why, it would be great to have this information in the error log.

infologie commented 4 days ago

I can't either. @Myllaume do you see where the problem could come from?

oledeuff commented 4 days ago

Maybe there is a mistake with the csv link if you used markdown files. You have to fill the place of your data in the yaml et let the link of csv files empty.

On Sat, Nov 23, 2024 at 2:29 PM Arthur Perret @.***> wrote:

I can't either. @Myllaume https://github.com/Myllaume do you see where the problem could come from?

— Reply to this email directly, view it on GitHub https://github.com/graphlab-fr/cosma/issues/152#issuecomment-2495480169, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2ELM7BBS5EXCF3QWHE6CL2CB7J5AVCNFSM6AAAAABSLBM5VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJVGQ4DAMJWHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Myllaume commented 4 days ago

This is a problem with files parsing: Cosma is unable to separate the header from the body of the files.