dalelane/scratch-extension-development

If you open a saved file using a new extension you get the error "The project file that was selected failed to load."

Opened this issue · 1 comments

First off, amazing work and I'm enjoying coding my new extension.

The issue I'm having is if I save off a project in scratch and try and reload it.

I can drop any blocks I like from the default extensions or plain scratch and those projects load no problem.

Whenever I add a single block from my created extension, save it off, then try and reload it, I get the error "The project file that was selected failed to load."

image

And the console shows

DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://example-url-5xvw94q74wcw6g-8000.app.github.dev/customExtension' failed to load.

customExtension is the id given to the extension in getInfo and it's trying to load it from the root directory of the space / but it gives a 404 when you try and open that URL. Is there some confusion about where new extensions are packaged and live when it tries to open it up from a saved file?

Or is there a step required to register the URL of the extension so it knows where to load it from?

Or perhaps this is specifically a me issue

It should "just work" if you follow the instructions as-is - I've not seen any issues with saving/opening sb3 files before.

Would you be willing to share the URL of your Scratch fork so I can try it for myself, please?