Skip to content
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

Fictional JSON5 Object Breaks All Functionality #15

Open
TheSeg opened this issue Sep 28, 2022 · 5 comments
Open

Fictional JSON5 Object Breaks All Functionality #15

TheSeg opened this issue Sep 28, 2022 · 5 comments

Comments

@TheSeg
Copy link

TheSeg commented Sep 28, 2022

With the latest update, I am unable to run any of my previously functioning shortcuts.

While I'm a front-end developer, this is my first time in the world of Stream Deck development, but I found the problem. After enabling debug mode, I found this problem in main_pi.js:

Screen Shot 2022-09-28 at 10 48 05 AM

There is no JSON5 object, only JSON. I tried to find the file in this repo, but apparently it's from somewhere else?

@SENTINELITE
Copy link
Owner

Hey, @TheSeg! 👋🏼

Hmm. Not getting this on my end, but this looks to be a good find!

The package is listed on the main_pi.html file. It should be on line 16: <script src="https://unpkg.com/json5@^2.0.0/dist/index.min.js"></script>

CleanShot 2022-09-28 at 11 47 46@2x

I happened to miss that there was an updated version of JSON5, can you switch that line to https://www.unpkg.com/browse/json5@2.2.1/ & see if that resolves the issue?

After making the changes make sure to save the script, & restart the Stream Deck Software!

Let me know how that works out!

@TheSeg
Copy link
Author

TheSeg commented Sep 28, 2022

There's a number of problems with that HTML file, but since it's not in the repo, I can't do a PR.

First the triage. The Sentry script line isn't properly closed and missing the closing > after crossorigin. What actually fixed the issue was a less restrictive semantic version definition as ^2.0.0. I used ~2 as that should catch patches while still giving the level of support expected from a third-party. There's weirdness that unpkg has with redirects which may be a contributing factor.

<script 
    src="https://browser.sentry-cdn.com/7.13.0/bundle.min.js"
    integrity="sha384-r+KUPXXgkLQFWmyqriU1/6I8hKYt0wW+3XTsbVK75r6hlPjAg8TNYgEdyCuq+41e"
    crossorigin="anonymous">
</script>
<script
  src="https://unpkg.com/json5@~2/dist/index.min.js"
>
</script>

But the question I have: Why do you need the third party JSON5 library in the first place? As a test I did the standard JSON and things worked fine. I confess I haven't deep-dived with testing, but what's the point of introducing a third party library in the first place?

@SENTINELITE
Copy link
Owner

Hey, @TheSeg!

Thanks for the swift reply.

Some user's with larger libraries were getting issues, parsing the JSON with italics & whatnot. From some research, it seemed that JSON5 handled these seamlessly, & was an easy fix.

I could probably switch back to standard JSON, with better handling of edge cases, but plan on saving that, for the forthcoming rewrite, which will happen when I find some more time! 😅

I had no idea that we could pass in ~2! That's a neat little trick!!!

PR's are very much welcome, as I'm not great with JS/HMTL/CSS! The front end code is located in this repo.

@TheSeg
Copy link
Author

TheSeg commented Sep 28, 2022

Is there a reason these have to be separate repos?

Also, I'm unable to open this project properly in Xcode. There's no *.xcodeproj or similar.

@SENTINELITE
Copy link
Owner

Hey, @TheSeg!

I went ahead & shared the project file. Let me know if you're able to open it up now.

Also, can you check under the Signing area, & tell me what you're seeing under the Team id & Certificate sections? I was hesitant to share this file, as there's account information listed here. Should be scrubbed, but if not, please let me know! 😄

CleanShot 2022-09-29 at 16 06 36@2x

As for including the other repo in the Xcode project, I'll take a look into that this weekend.

Would you like to submit a PR for the JS, or shall I go ahead & push the changes? Would love to give you credit for the assistance.

I truly appreciate getting some outside feedback into the project, as this is all a learning experience for me. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants