klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
1.85k stars 287 forks source link

JavaScript Support Issues #1204

Closed BlueDonutStudios closed 1 year ago

BlueDonutStudios commented 1 year ago

Describe the bug.

TESTING A KNOWN WORKING TWINE PROJECT- Critical stop error when testing in Twine 2.4.1 Desktop wrapper version and browser version.

When using the 'test' feature, when compiled, both the application and browser versions of Twine produce errors that look like Javascript issues: @https://twinery.org/2/static/js/main.32bd2de0.chunk.js:1:63578 at/i<@https://twinery.org/2/static/js/main.32bd2de0.chunk.js:1:154836 at@https://twinery.org/2/static/js/main.32bd2de0.chunk.js:1:155216 Zi@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:578260 ks@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:624490 gl@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:617219 vl@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:617142 sl@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:614151 Qo/<@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:565522 t.unstable_runWithPriority@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:640923 Ko@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:565231 Qo@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:565469 Yo@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:565402 R@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:634688 Yt@https://twinery.org/2/static/js/2.fb96f5c8.chunk.js:2:542674 patchedCallback@https://twinery.org/2/:132:45

Steps to reproduce:

Run Test or Build and Play.

Expected behavior:

Works in 2.3 versions.

Additional context on this problem.

This is the Javascript - which worked fine before Twine 2.4.1

`/ twine-user-script #1: "harlowe-audio.min.js" / /**

/ twine-user-script #3: "test.js" / $(document).on('keyup', function (ev) { if (ev.which !== 192) { return; } $('tw-hook[name="secret"] tw-link').trigger('click'); });`

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?

Windows

If this problem is occurring with the web version of Twine, what browser does it occur on?

Chrome/Chromium

Presubmission checklist

greyelf commented 1 year ago

Each Story Format defines what support for JavaScript it includes, if any.

Harlowe has been deliberately designed to limit how JavaScript can be used by an Author to add/extend the functionally of their project, and of the Harlowe engine itself.

The recent v3.3.x releases of Harlowe included with the Twine 2.4.x application contained changes that resulted in the third-party Harlowe Audio Library by Chapel no longer working. A note about this can be found on the HAL site.

The developer of Harlowe is looking into this matter, and a potential replacement audio system.

webbedspace commented 1 year ago

Are there still issues with Harlowe 3.3 and HAL? I thought HAL v2.3 fixed the big one, and I haven't seen any issues since then...

greyelf commented 1 year ago

@webbedspace

Are there still issues with Harlowe 3.3 and HAL?

I don't know, but based on the comment header of the original poster's example it appears that @BlueDonutStudios is still using v2.2.1 of HAL.

@BlueDonutStudios Try updating HAL to the current released version and see if that fixes your issue.

klembot commented 1 year ago

This sounds like it's a Harlowe issue--if it's not in fact, please re-open and I can take another look.

BlueDonutStudios commented 1 year ago

I've checked the version of Harlowe and it's 3.2.3. Harlowe 3.3.1 breaks. I looked in the Story>Details> Story Format and I see that I can only change the Harlowe format between 2.1.0 and 3.31.This could therefore be a compatibility issue between the versions of Harlowe, however the new version of Twine will not allow me to switch to Harlowe 3.2.3. Are you planning to provide the option of switching to Harlowe 3.2.3? Meanwhile we will keep a machine on Twine 2.3.15 so it works for maintenance.

BlueDonutStudios commented 1 year ago

I checked the updated HAL. Yes that fixed the problem. So good to close. Big thanks to @klembot, @greyelf and @webbedspace for their assistance. For reference here is the link to the Harlowe Audio Library that I used to fix my problem following this discussion thread.: https://github.com/ChapelR/harlowe-audio/releases/tag/v2.3.0