microsoft / pxt-arcade

Arcade game editor based on Microsoft MakeCode
https://arcade.makecode.com
MIT License
477 stars 207 forks source link

MakeCode Tutorial tool not pulling tutorial from GitHub #5861

Closed bmarslandCN closed 1 year ago

bmarslandCN commented 1 year ago

Describe the bug I am encountering a bug with storing a tutorial in a github repo and opening it in MakeCode Arcade.

We have several tutorials being stored in a github repo https://github.com/Code-Ninjas-Home-Office/game-building-session-tutorials and have added the tutorial names to the pxt.json files section. The other tutorials are all able to be opened, except one tutorial (https://github.com/Code-Ninjas-Home-Office/game-building-session-tutorials/blob/master/ninja-stars.md), and we cannot figure out what is causing this issue. I have gone through the code several times and found no difference from other tutorials that are opening correctly. I have cleared my cache and tried other browser windows and incognito windows. I have even deleted the code and created a new file with the same code and the same result.

To Reproduce Steps to reproduce the behavior:

  1. Go to (https://arcade.makecode.com/#tutorial:https://github.com/Code-Ninjas-Home-Office/game-building-session-tutorials/ninja-stars)
  2. See error

Expected behavior The tutorial should open in the MakeCode Tutorial tool, as the other ones do.

Screenshots image image

Desktop (please complete the following information):

Thank you! @kiki-lee @riknoll @jwunderl @abchatra

jwunderl commented 1 year ago

The code snippets appear to have been pasted in weirdly into the file -- if you look at the raw text, there's a lot of extra spacing, and when I inspect it I'm seeing some non-breaking spaces that appear to be thwarting the JSON parser

image

Did you possibly copy these into word or another word processor before putting them into the git repo? anyways, replacing the nbsp's with normal spaces appears to fix it, e.g. https://arcade.makecode.com/#tutorial:17962-74287-62095-51746. I put up https://github.com/Code-Ninjas-Home-Office/game-building-session-tutorials/pull/1 that should fix it.

bmarslandCN commented 1 year ago

@jwunderl in fact, we did copy/paste it from a Word doc (which caused lots of other issues too!) Funny enough I was just about to edit that and the copy/pasted assets.json file too. Will update and test. Thank you!

kiki-lee commented 1 year ago

So, the project works when you remove the assetjson. I'm wondering if you're defining something in the pxt.json for this tutorial that's also defined in the parent directory?

Screenshot by Dropbox Capture

When I swap in the assetjson from find-the-ninja, I can get this to work.

kiki-lee commented 1 year ago

I was late to the party ^ :)

bmarslandCN commented 1 year ago

@kiki-lee not late at all! that only helped to confirm that the assets.json file needed to be updated too. thank you for helping me debug!

bmarslandCN commented 1 year ago

IT WORKS! Thank you both so much @kiki-lee @jwunderl