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

Big button and little button on the Navbar at the same time with OctoPrint 1.4.1rc2 #14

Closed
b-morgan opened this issue Jul 9, 2020 · 12 comments

Comments

@b-morgan
Copy link

b-morgan commented Jul 9, 2020

I upgraded from 1.4.0 to 1.4.1rc2 (I skipped rc1) and now both the big button and the little button are on the Navbar at the same time. Furthermore, the setting for which button to display doesn't appear to work.

@b-morgan
Copy link
Author

b-morgan commented Jul 9, 2020

There are no entries in config.yaml for this plugin.

@lbussy
Copy link

lbussy commented Jul 9, 2020

Concur, I saw that as well. I ended up having to restart in safe mode, as SES is not the only plugin which seems to have issues.

@Sebclem
Copy link
Owner

Sebclem commented Jul 9, 2020

Any logs/error in the chrome devTools Console ? (F12 to open)

I can't reproduce the issue on my setup

@b-morgan
Copy link
Author

b-morgan commented Jul 9, 2020

I guess it's more insidious than I thought. Chrome Version 83.0.4103.116 (Official Build) (64-bit) works.

FireFox 78.0.1 (64-bit) does not. It displays both buttons. Neither button has a tooltip on mouseover and neither button works. With OctoPrint 1.4.0, the plugin was working in FireFox, With OctoPrint 1.4.1rc2 it doesn't.

I have a second RPi loaded with OctoPi which hasn't been updated yet (in fact, I think it's hosed as I can't login atm). I'll get that working again and recheck with OctoPrint 1.4.0.

@lbussy
Copy link

lbussy commented Jul 9, 2020

Verified the conflict occurs when enabling Octolapse 0.4.0 under Octoprint 1.4.1rc2 using Firefox:

Capture

Below is the console log:

09:22:08.073 Navigated to https://octopi.local/#temp
09:22:09.174 Firefox can’t establish a connection to the server at wss://octopi.local/sockjs/694/dtocqg45/websocket. packed_libs.js:1206:23008
09:22:09.286 The connection to wss://octopi.local/sockjs/694/dtocqg45/websocket was interrupted while the page was loading. packed_libs.js:1206:23008
09:22:09.383 Some cookies are misusing the recommended “sameSite“ attribute 30
09:22:09.489 This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. octopi.local
09:22:09.674 Uncaught SyntaxError: nothing to repeat packed_plugins.js:1:6
09:22:09.794 Starting dependency resolution... packed_core.js:850:521
09:22:09.833 ... dependency resolution done packed_core.js:860:5
09:22:09.835 Initial application setup done, connecting to server... packed_core.js:883:835
09:22:09.850 Initialized error tracking octopi.local:16849:13
09:22:10.620 Connected to the server packed_core.js:702:350
09:22:10.720 Triggering connect on all view models packed_core.js:707:240
09:22:10.722 Server (re)connect processed packed_core.js:709:5
09:22:10.723 Finalizing application startup packed_core.js:883:211
09:22:11.037 Going to bind 37 view models... packed_core.js:866:39
09:22:11.476 Did not bind view model BackupViewModel to target #wizard_plugin_backup since it does not exist packed_core.js:876:44
09:22:11.507 Did not bind view model UsageViewModel to target #wizard_plugin_tracking since it does not exist packed_core.js:876:44
09:22:11.615 Did not bind view model SoftwareUpdateViewModel to target #softwareupdate_confirmation_dialog since it does not exist packed_core.js:876:44
09:22:11.616 Did not bind view model SoftwareUpdateViewModel to target #wizard_plugin_softwareupdate since it does not exist packed_core.js:876:44
09:22:11.677 User octopi logged in packed_core.js:158:560
09:22:11.684 ... binding done packed_core.js:881:152
09:22:11.684 Application startup complete packed_core.js:881:444

@foosel
Copy link

foosel commented Jul 10, 2020

FYI, the issue is that something inside this plugin's JS files doesn't sit well with being minified through OctoPrint. Minification got reenabled as part of a PR that got included in 1.4.1rc1 and rc2. Considering this observed breakage here I guess I need to disable it again.

foosel added a commit to OctoPrint/OctoPrint that referenced this issue Jul 10, 2020
It might cause SyntaxErrors in third party plugins that cannot be
caught by the system and which then nuke ALL other third party plugins.

See Sebclem/OctoPrint-SimpleEmergencyStop#14 and
FormerLurker/Octolapse#567

This change can manually be applied by setting

``` yaml
devel:
  webassets:
    minify: false
```

in config.yaml
@Sebclem
Copy link
Owner

Sebclem commented Aug 4, 2020

@foosel Can i do something on my side to prevent this ?

Or are you planing to keep minification off ?

@foosel
Copy link

foosel commented Aug 4, 2020

It's off by default for third party plugins, but there's a setting in config.yaml via which plugin authors can reenable it to test if their plugin works properly. I plan on hopefully utilize that setting in a future plugin validation github action.

You certainly should make sure your plugin works minified too, so turn it on and check what is breaking there exactly and fix it. Usually it's something like a forgotten ;

@Sebclem
Copy link
Owner

Sebclem commented Aug 4, 2020

@foosel I think it's more an Octolaps issue.

I have setup a dev server to fix this issue and if i only install the Octolaps plugin, i have an error un firefox:

SyntaxError: nothing to repeat                                           packed_plugins.js:1:6

If i only install my plugin, there is no issue.

I also have checked my JS file and add some missing ; (e80ec69)

@foosel
Copy link

foosel commented Aug 4, 2020

Ah, then @FormerLurker also needs to check something there.

@FormerLurker
Copy link

@foosel, I will take a look at this. I would prefer my code to be minified too :). I was running it with the minification with one of the earlier releases and didn't notice any syntax errors, but will try it with this plugin installed and see what's going on.

@Sebclem, as a workaround you could disable the octolapse navbar icon within the Octolapse main settings and see if that solves the issue temporarily.

@Sebclem Sebclem closed this as completed Jan 4, 2021
@FormerLurker
Copy link

@Sebclem, I just saw this and realized I forgot to post my findings. I tracked the issue down to one of three files:

jquery.minicolors.min.js
jquery.validate.min.js
showdown.min.js

Not sure yet which one is the culprit, but it appears the minifier has trouble with previously minified code. I ran this script through the .net bundler, and it didn't have any issues. It doesn't look like it touches any files ending with .min.js, which I believe is the appropriate way to handle this.

Also, fyi, just to double check, I added all missing semicolons to all 3 of those files, which made no difference. The minification process typically strips out the final semicolon in a block, and it was those that I re-added.

TLDR: Replacing all of the .min.js files with non-minified content solved the error you were seeing. There were several missing semicolons in my own files, but none that would trigger any syntax error. Adding those made no difference.

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

5 participants