-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If you open a saved file using a new extension you get the error "The project file that was selected failed to load." #7
Comments
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? |
I had the same issue. My extension ID was mqtt => didn't worked. With Dale's example it did work. So at the end I change the ID of my blocks to : yourScratchExtension and now it does work with loading saved files. As it took me already longer to get here I haven't tested if it was because mqtt maybe corresponds to an existing module or if it really needs to be exactly yourScratchExtension.... but I think it could help somebody: no working:
working:
|
It doesn't need to be that, but it does need to match the other references to the extension ID, in:
|
Hi Dale. Thanks for the fast reply. But honestly I don't get it yet: Regards |
Let's break this line down a little further:
You can use any string you want for either of these. There are no special names. The only trick to this is updating all the references to keep everything in sync, not just update one side but not the other. |
I thank you for the explenation! |
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."
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
The text was updated successfully, but these errors were encountered: