UofTMADLab / reach-dist

reach is a twine story format for authoring immersive XR narratives, environments and prototypes.
MIT License
4 stars 0 forks source link

Unhandled Rejection (Error): Couldn't load story format properties #2

Open thibaud opened 2 years ago

thibaud commented 2 years ago

Hi, thanks you for this great project! It works fine with twine online. However, when I add the reach format from the README to twinejs (local installation), when I launch the story, I get an error. Is there a specific release I have to use with reach-dist, or how can I correct the code?

On the js console I get this error from http://localhost:3000/story-formats/harlowe-3.2.1/format.js?callback=storyFormat Uncaught SyntaxError: Unexpected token '<'

Here the log from Twine:

Unhandled Rejection (Error): Couldn't load story format properties (anonymous function) src/store/use-publishing.ts:88 85 | ); 86 | 87 | if (!formatProperties) {

88 | throw new Error(Couldn't load story format properties); | ^ 89 | } 90 | 91 | return publishStoryWithFormat( View compiled async load src/routes/story-test/story-test-route.tsx:16 13 | 14 | React.useEffect(() => { 15 | async function load() { 16 | replaceDom( | ^ 17 | await publishStory(storyId, { 18 | formatOptions: 'debug', 19 | startId: passageId

samesimilar commented 2 years ago

Bonjour Thibaud! Thank you for submitting this issue. I am happy to help.

After a few quick tests here, I'm not able to duplicate your problem yet.

I am using:

(I downloaded the Twine app from the Twine website. )

I see harlow-3.2.1 mentioned in the source (URL) of the error. I don't think the Harlowe story format should be involved if you have set the story format to reach. My first suggestion is to make sure that you have selected reach as the story format for your particular story before running it.

If that doesn't help please tell me more about your local environment for running twine and the steps you are taking to run your story. I would be happy to do some further investigation.

Here are a couple screenshots for illustrative purposes. The first one shows the Story Format list on the main Twine menu, and the second shows the Choose Story Format options for one particular story.

Screen Shot 2021-12-18 at 1 07 09 PM Screen Shot 2021-12-18 at 1 12 32 PM
samesimilar commented 2 years ago

It is not mentioned in the readme, but earlier this year I wrote this companion guide for reach. Maybe it will be helpful for getting set up:

https://ecampusontario.pressbooks.pub/reach/front-matter/introduction/

thibaud commented 2 years ago

Thanks, Michael! You helped me to understand that the problem was not from the format, so I checked the environment and I discover that the installation was not as simple on a mac as on a Linux. I use Ubuntu 21.04, and installed the 32 bits version. I didn't understand how to install it with the package from the twine homepage: the script freezes. However, I installed twinejs from the github's klembot. Following the README, I launched "npm install" then "npm start". However, this is a dev release, and Reach format doesn't work with it. The good approach is to launch "npm run start:electron": this is the stable release. In this environment, Reach works fine. I hope that information will be useful for a Linux user of Reach... On Ubuntu 21.04, reach 1.0.61 works fine with Twine@2.4.0-beta1 postbuild:web !

Congrats on your book! It's very well explained, in a very pedagogical way. Besides, I edited the reach format to add HTML elements and get new CSS and js formats. I added a map feature, a sticker that authorizes you to move quicker on the place. Do you want to see it? I can send you a link by email for testing if you want.

In this VR, The problem I meet is that I get a lot of warning messages that slow the loading of pictures a lot, particularly at the first step. Like this: three.js:48622 THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo(). Reach is a very interesting tool, I think that we should work on it to improve the virtual tour experience!

samesimilar commented 2 years ago

Thank you - I'm glad you were able to get it running!

I am excited to see what you are working on. I will connect directly with the e-mail from your profile so you can send me a link.

I have noticed the nearestPowerOfTwo problem before myself also. The version of threejs that we are using is inherited from the version of aframe that reach depends on. I guess it is time rebuild and test reach with the latest release of those libraries. I will open an issue to track this problem here.

In the meantime, maybe try resizing your images (before uploading them) so that each dimension is exactly a power of two in size e.g. 256, 512, 1024, pixels etc. That might cause it to skip the call to nearestPowerOfTwo. That should help with the loading time if you are not doing it already, since your images will be resized in the browser on the fly each time they are loaded if they do not already obey this rule.