chinchang / web-maker

A blazing fast & offline frontend playground
https://webmaker.app
MIT License
2.57k stars 316 forks source link

Creations and import of creations unavailable after update to version 6.x #566

Closed alexnlong closed 3 months ago

alexnlong commented 3 months ago

Meta info

I fortunately exported my code prior to using the latest version of the web app, but now I am unable to access my past creations at all, nor can I import them from a backup. When I attempt to import I see "i18n is not defined" in the devtools console. I was able to replicate this in Firefox (uBlock disabled) and MS Edge (no blockers installed).

chinchang commented 3 months ago

Hi @alexnlong you said you are not able to access your past creations. Do you see any error in devtools console when you click "Open"

alexnlong commented 3 months ago

I don't get an error after clicking "Open", no warnings either. I might have messed up by signing into Github and then loading the app from a different computer. On the second computer the app's creation list was empty. When I returned to the first computer, the list is now also empty.

Luckily (or so I thought) I had the mind to export the creations before doing the above. However I am not able to import the backup JSON.

Edit: I've created a new code snippet and exported its JSON to compare with my previous backup. It looks like the "id" key-value is different, for example, in the previous version of the JSON an "id" value looks like "item-, while in the new exported JSON the "id" value looks like ". I'm not sure if that is the only difference, but it sticks out; perhaps backups from previous versions of the app do not work in version 6?

Edit 2: I've tried deleting the new code snippet from the list of creations and importing it. Importing still fails with the error "i18n is not defined" showing up in devtools.

Yet Another Edit: I was able to import my creations using MS Edge, since I've never used it for this app before, and it's not logged into any account. Then I did try to log into WebMaker using MS Edge, and when prompted to import my creations to my account, I clicked "Yes, please import". It failed with an error:

bundle.c8415.js?_sw-…30705b96e35a9561:84 
 Uncaught 
TypeError: window.db.getDb(...).then is not a function
    at Object.saveItems (bundle.c8415.js?_sw-…e35a9561:84:1380205)
    at JF.mergeImportedItems (bundle.c8415.js?_sw-…e35a9561:84:1429298)
    at JF.importCreationsAndSettingsIntoApp (bundle.c8415.js?_sw-…e35a9561:84:1429499)
    at HTMLButtonElement.<anonymous> (bundle.c8415.js?_sw-…6e35a9561:84:552252)
chinchang commented 3 months ago

Hi @alexnlong! That error message really helped fix the import issue. You should be able to import creations now, whether logged in or not. Regarding creations not being available, I think you might have logged in to another account through a different social account and that is why you see no creations. Can you please log in again to the account which should have all the saved creations, and in the console run: window.user.uid. This will give you your uid. Please mail that to me on chinchang457@gmail.com

Really sorry for the inconvenience caused here.

alexnlong commented 3 months ago

@chinchang Thank you, that was it. My creations weren't bound to an account, I had used WebMaker while not logged in to any account. When I logged into the app via my Github account, the creations list was empty, but when I logged out the creations were there again. So now I'm back to trying to import them into the app while logged in. I'm still running into an issue where I get an error while trying to import at this screen:

Screenshot 2024-06-22 122554

Uncaught (in promise) FirebaseError: Missing or insufficient permissions.
chinchang commented 3 months ago

I think I have some idea what might be happening. @alexnlong Would it be possible to join the Web Maker discord here -> https://discord.gg/v4APKsqmXP Will be faster to-n-fro to fix this issue.

chinchang commented 3 months ago

Hi @alexnlong I have released a fix for the reported issue. Now when you try to import some creations which might be already imported in another account, they will still save to your new account. Please do try and let me know how it goes.