twinejs
twinejs copied to clipboard
Import of story displays error page "Twine can't continue"
Describe the bug.
Using a fresh install of Twine, imports of stories frequently fail.
Steps to reproduce:
- Import https://klembot.github.io/chapbook/examples/cloak-of-darkness.html
- The following error page appears

Expected behavior:
The story should be imported and it should be possible to display it.
Additional context on this problem.
I've never installed or used Twine before.
Twine version number
2.4.1
Does this problem occur with the web version of Twine or the desktop app?
Desktop app
What operating system does this problem occur on?
macOS
If this problem is occurring with the web version of Twine, what browser does it occur on?
No response
Presubmission checklist
- [ ] I am interested in working on code that would fix this bug. (This is not required to submit a bug report.)
- [X] I have done a search and believe that an issue does not already exist for this bug in the GitHub repository.
- [X] I have read and agree to abide by this project's Code of Conduct.
Could you attach a file that triggers this?
It is the html file from the above link. I've zipped it up and attached it, as it won't let me attach an html file directly. cloak.zip
Ah whoops. I didn't read carefully enough. I'll take a look.
The issue is that the Cloak of Darkness sample doesn't have a format or format-version attribute on tw-storydata, i.e. it's a problem with the file rather than the app.
Having said that, it would be nice if Twine didn't unrecoverably crash when you open a story whose Format hasn't been loaded. From the documentation, that isn't what's meant to happen.
I have the same issue, with stories that do have format on them though not format-version. When I refresh the error page, I get the editor, but after that testing/playing the story fails, presumably for lack of the format-version, though the errors seem to indicate some issues tracking the IFID as well. (The IFID is on my tw-storydata.)
[Warning] Passage 54f10db9-0c53-4444-a1eb-fdf774a21289 is orphaned (looking for story ID 2a91814e-cebc-4261-b7a5-2b3a5b42931d), skipping (main.32bd2de0.chunk.js, line 1)
[Warning] Passage 13a40308-4ce2-43d9-bf24-9282ff3ea8df is orphaned (looking for story ID 2a91814e-cebc-4261-b7a5-2b3a5b42931d), skipping (main.32bd2de0.chunk.js, line 1)
[Warning] Passage cdfa680b-ac42-477c-8f5a-45f9c5b27766 is orphaned (looking for story ID 2a91814e-cebc-4261-b7a5-2b3a5b42931d), skipping (main.32bd2de0.chunk.js, line 1)
[Info] Repairing story (name: "TEST", id: 25d0c4e5-89d6-4dae-a197-1b858245704b) by setting storyFormat to Harlowe, was SugarCube2 (was bad type or unset) (main.32bd2de0.chunk.js, line 1)
[Info] Repairing story (name: "TEST", id: 25d0c4e5-89d6-4dae-a197-1b858245704b) by setting storyFormatVersion to 3.3.1, was (was bad type or unset) (main.32bd2de0.chunk.js, line 1)
[Error] Unhandled Promise Rejection: Error: The passage set as starting point for this story does not exist.
dispatchException (2.fb96f5c8.chunk.js:2:648279)
(anonymous function) (2.fb96f5c8.chunk.js:2:644507)
r (2.fb96f5c8.chunk.js:2:39843)
l (2.fb96f5c8.chunk.js:2:40083)
promiseReactionJob
You can get my test stories here. They were automatically generated with Twee2. At some point I will regenerate them with Tweego to fix the omission, but it seems that handling of unknown story formats or versions should be a bit more forgiving.
I think the general idea is, we need to repair stories immediately after importing them.
Just to add another data point — we've talked about this error when a story format isn't specified, or when the format is specified but the version is missing, but I just got the same crash from having a format and version specified, but the correct version not being installed (in this case Harlowe 3.2.1)
Weirdly, I can't reproduce the bug using the Cloak of Darkness example uploaded here. It imports for me fine. Could someone add another example that doesn't work?
I can add repairing after import, but without a repro I can't be confident this actually fixes any problems.
Weirdly, I can't reproduce the bug using the Cloak of Darkness example uploaded here. It imports for me fine. Could someone add another example that doesn't work?
I linked my test stories in my comment above. They haven’t changed, and should all produce the same behavior.
@mcdemarco very strange. I feel like there's something else at work here. I downloaded the "Using Harlowe" link and imported that, and it worked.
@mcdemarco very strange. I feel like there's something else at work here. I downloaded the "Using Harlowe" link and imported that, and it worked.
The only unusual thing happening for me is that the story title is always a duplicate (my test stories are all named Test Story), so I'm always checking the box to replace the previous test story. You could try reimporting my Harlowe story or importing one of the others to test this.
I have the issue come up consistently when the file is created in an older version of the editor (2.3.16 is what I use). When I import a story that already exists in the new editor, the new editor will not update the story, and in order to see my changes made in the old editor I need to delete the copy in the new editor and import. Refreshing after the crash produces the expected behavior. I'm using Mac OSX Catalina and Firefox.
The attached video shows me creating a file in the old editor and getting a crash on opening in the new editor. https://user-images.githubusercontent.com/69982874/182478086-806a9362-5473-4488-a91f-594cf326190a.mp4