leahiel / Primitive-StoryFormat

A StoryFormat for print viable Interactive Fiction for Twine.
BSD 2-Clause "Simplified" License
4 stars 0 forks source link

Cannot read properties of undefined (reading 'getAttribute("name")') #2

Open gimli2 opened 2 months ago

gimli2 commented 2 months ago

When switched story format to the Primitive 0.2, the story cannot be tested/played. In the dev tools console you can see:

Book:194 Uncaught 
TypeError: Cannot read properties of undefined (reading 'getAttribute')
    at Book.html:194:19241

which points to the last line of this part of story JS:

let _truepassagenames = function(text) {
                            let passages = text.split(" --\x3e ");
                            return passages = passages.join("\n"),
                            passages = passages.split("\n"),
                            passages.shift(),
                            [...new Set(passages)]
                        }(function(psg) {
                            let connections = []
                              , scanned = [psg.getAttribute("name")]

What could be configured improperly?

using:

The tag "start" was added to the first passage.

leahiel commented 2 months ago

Looks like, according to that error, the Parser didn't add your start passage to its list of passages.

There's a few things that could be an issue.

Would you be willing to share your Story code, if you still have it, so I can look into this more? Additionally, have you tried compiling the included test story?

PS. Sorry for the late reply, you can always find me faster at the Twine Discord. I'm currently in intensive training, so I won't be keeping a tab on peripherals like GitHub for another few months.