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

Failed to load 'node-red-dashboard/ui_base' #402

Closed
mlewis26201 opened this issue Jun 5, 2018 · 26 comments
Closed

Failed to load 'node-red-dashboard/ui_base' #402

mlewis26201 opened this issue Jun 5, 2018 · 26 comments

Comments

@mlewis26201
Copy link

I have had this happen on two fairly new installs on Rasbian Stretch, so I am not sure if it is a bug or something I am breaking.

Node-Red itself seems to be working fine, but after some period of time after rebooting, I lose the dashboard tab on the right next to "debug". I also get a warning at the top of the browser on initial load that says:
"Failed to load 'node-red-dashboard/ui_base'"
"TypeError: $.widget is not a function"

I tried so many combinations of npm install/reinstall, with and without -g with no change in the problem.

node.js version: v8.11.2

Problem occurs with both Chrome and IE.

I did find a ui_base,js and ui_base.html:
pi@hahub:~/.node-red/node_modules/node-red-dashboard/nodes $ ls -l ui_base*
-rw-r--r-- 1 pi pi 115540 May 23 21:18 ui_base.html
-rw-r--r-- 1 pi pi 3736 May 18 07:57 ui_base.js

No idea what I am looking at, but also found this:
pi@hahub:~/.node-red/node_modules/node-red-dashboard/nodes $ grep $.widget ui_base*
ui_base.html: $.widget("nodereddashboard.elementSizerByNum", {
ui_base.html: $.widget( "nodereddashboard.elementSizer", {

Any ideas on what is happening or what I am doing to break it? And, how to fix?

@dceejay
Copy link
Member

dceejay commented Jun 6, 2018

not seen that here (yet). Is the browser running on the Pi ? I assume not as you also mention IE.

@mustafasei
Copy link

May be your issue same mine. I cannot see the dashboard /ui after finishing the project even I can see the dashboard items on the left side

@battika
Copy link

battika commented Jul 2, 2018

Same issue here with Google Chrome. Funny thing when I am using Safari it works fine.

@dceejay
Copy link
Member

dceejay commented Aug 17, 2018

Any more reports of this ? anyone able to recreate this ?

@Roger53
Copy link

Roger53 commented Sep 7, 2018

Love your work 👍

Not sure it is the same, but certainly a look-a-like :-)

For me it went wrong between 2.9.6 and 2.9.7, and as you dont have dates in your changelog I dont know if it fits above complaint ( Dates would be handy ).

I am using a docker image on Orange Pi One with latest armbian and a self build image, based on : arm32v7/node:10.9.0-slim which is based on debian:jessie-slim

I upgraded a few days ago to Dashboard version 2.9.7 and lost the ui in Windows10 Internet Explorer 11, while FF and Edge on same machine worked fine.
All works fine, except the ui : Screen is white and empty ( normally it starts with a black background )

I made a second docker image where I forced a downgrade to Dashboard version 2.9.6 and the ui worked again for IE11 ( Everything 100% the same, except dashboard version )

I also got today a Dashboard version 2.9.8, same problem.

There is some caching going on, that confuses things, so close/open explorer and paste basic url (.../ui for every test ! refresh is not enough)
I see many warnings / errors for both versions, except this one in IE (F12) :

Creating AppCache with manifest: 'http://192.168.X.X:1880/ui/dashboard.appcache'.
TypeError: Object doesn't support property or method 'assign'
{
[functions]: ,
proto: {
[functions]: ,
proto: {
[functions]: ,
proto: {
[functions]: ,
proto: null
},
message: "",
name: "Error"
},
message: "",
name: "TypeError"
},
description: "Object doesn't support property or method 'assign'",
message: "Object doesn't support property or method 'assign'",
name: "TypeError",
number: -2146827850,
stack: "TypeError: Object doesn't support property or method 'assign'
at f.defaults (http://192.168.X.X:1880/ui/js/app.min.js:503:14084)
at f.copyOptions (http://192.168.X.X:1880/ui/js/app.min.js:503:13393)
at g (http://192.168.X.X:1880/ui/js/app.min.js:501:12658)
at i (http://192.168.X.X:1880/ui/js/app.min.js:499:10133)
at Anonymous function (http://192.168.X.X:1880/ui/js/app.min.js:499:10352)
at f (http://192.168.X.X:1880/ui/js/app.min.js:504:24853)
at dfunction (http://192.168.X.X:1880/ui/js/app.min.js:504:25631)
at d (http://192.168.X.X:1880/ui/js/app.min.js:504:393)"
}

Hope this helps repairing ?
Until then I am using 2.9.6, no problem, but updates updates updates.....

@dceejay
Copy link
Member

dceejay commented Sep 7, 2018

Looks like this http://techcater.com/object-doesnt-support-property-or-method-assign/
You may be able to try that in a ui_template to test it. I’ll try a fix over the weekend.

@Roger53
Copy link

Roger53 commented Sep 7, 2018

Hi,
As test I only used a single button, i cant find ui template though,
As said no hurry,
Let me know when you fixed it, I will test it.

@dceejay
Copy link
Member

dceejay commented Sep 8, 2018

image
image

@Roger53
Copy link

Roger53 commented Sep 10, 2018

Hmm, never used that block, never needed it, no idea what it does ;-)

But tried your suggestion, but could not get that to work, but I am not an expert, just a simple user.

So what should I do with the original content "

"
I tried above, and below, but it always shows a red cross in editor the margin, "Expected Tag name. Got something else instead"
Although I can save.

So it is over my head, I would appreciate if you could have a look.

@dceejay
Copy link
Member

dceejay commented Sep 10, 2018

Can you try importing this node below - it's that template node with the "fix" from that website entered into it. I don't have IE11 to hand, and am out of the office for a trip, so am hoping you can test for me.

[{"id":"92dd7e31.9fa53","type":"ui_template","z":"dfe4ec36.0a5a5","group":"8a3c0162.4c8d1","name":"","order":0,"width":0,"height":0,"format":"if (typeof Object.assign != 'function') {\n  (function () {\n    Object.assign = function (target) {\n      'use strict';\n      // We must check against these specific cases.\n      if (target === undefined || target === null) {\n        throw new TypeError('Cannot convert undefined or null to object');\n      }\n\n      var output = Object(target);\n      for (var index = 1; index < arguments.length; index++) {\n        var source = arguments[index];\n        if (source !== undefined && source !== null) {\n          for (var nextKey in source) {\n            if (source.hasOwnProperty(nextKey)) {\n              output[nextKey] = source[nextKey];\n            }\n          }\n        }\n      }\n      return output;\n    };\n  })();\n}\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"global","x":600,"y":900,"wires":[[]]},{"id":"8a3c0162.4c8d1","type":"ui_group","z":"","name":"Chart","tab":"ed5f97bc.2d4ce8","disp":true,"width":"12","collapse":false},{"id":"ed5f97bc.2d4ce8","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

@Roger53
Copy link

Roger53 commented Sep 10, 2018

I appreciate that you try to solve asap, but as said, 2.9.6 works, so take your time, no problem. Have a nice trip

But I am always willing to test for you, no problem, the least I can do ;)

OK, so I did understand you correctly, but that does not work
It shows a red cross in editor in the margin, "Expected Tag name. Got something else instead"
But I can click done and deploy anyway without a warning

at this line : for (var index = 1; index < arguments.length; index++) {

@dceejay
Copy link
Member

dceejay commented Sep 10, 2018

Hi - OK - have pushed a test fix to master... you can install it by

cd ~/.node-red
npm i node-red/node-red-dashboard

fingers crossed

@Roger53
Copy link

Roger53 commented Sep 11, 2018

Hi,
So build a new docker container, with node-red-dashboard": "*", which normally would give the latest version.

Sorry to ask, but are you sure you did the push ? I still get Dashboard version 2.9.8 started at /ui , same as Sept 4, but I expected 2.9.9 or so ?

Anyway my new container with 2.9.8, has the same "assign" problem : is not solved.

@dceejay
Copy link
Member

dceejay commented Sep 12, 2018

no - it's in master not on npm so in package.json you need

 "node-red-dashboard": "node-red/node-red-dashboard",

it's still 2.9.8 - and you will need to flush your browser cache - ctrl-r to reload a couple of times.

@Roger53
Copy link

Roger53 commented Sep 12, 2018

all new to me, OK,
Build is ok, I see again "2.9.8"

But I see no difference, still white screen and error on IE, works fine on Edge / FF.
I assume that your fix should make the ui template not needed anymore, right ?

TypeError: Object doesn't support property or method 'assign'
{
[functions]: ,
proto: { },
description: "Object doesn't support property or method 'assign'",
message: "Object doesn't support property or method 'assign'",
name: "TypeError",
number: -2146827850,
stack: "TypeError: Object doesn't support property or method 'assign'
at f.defaults (http://192.168.X.X:1880/ui/js/app.min.js:503:14084)
at f.copyOptions (http://192.168.X.X:1880/ui/js/app.min.js:503:13393)
at g (http://192.168.X.X:1880/ui/js/app.min.js:501:12658)
at i (http://192.168.X.X:1880/ui/js/app.min.js:499:10133)
at Anonymous function (http://192.168.X.X:1880/ui/js/app.min.js:499:10352)
at f (http://192.168.X.X:1880/ui/js/app.min.js:504:24853)
at Anonymous function (http://192.168.X.X:1880/ui/js/app.min.js:504:25631)

at d (http://192.168.X.X:1880/ui/js/app.min.js:504:393)"
}

image

@Roger53
Copy link

Roger53 commented Sep 12, 2018

I got another IE problem : sizing of a bar chart after opening, Ill put it in a new thread, ok?

@dceejay
Copy link
Member

dceejay commented Sep 12, 2018

You still need to flush your cache...

and feel free not to use IE11 :-)

@Roger53
Copy link

Roger53 commented Sep 12, 2018

Yes flushed, also via the menu's,

Not using IE ? Yes sure, but I use Firefox for internet, with adblock clear history, block / delete cookies etc, etc, making it slower and forgetfull.

My IE has no internet access (ZoneAlarm) also no additions mentioned above, making it work very fast and remembers some stuff.

Isn't everybody doing that than, to have some protection :-) ? Should !

Ok, so can we try something else ?

What did you change between 2.9.6 and 2.9.7 that could cause this, because that is where the problem started ?

@dceejay
Copy link
Member

dceejay commented Sep 12, 2018

I believe it is now fixed - and is in github as per above. I'm not sure why you can't get it to refresh properly. It will be released to npm as part of 2.9.9 as and when.
I guess one of the other dependencies started to use Object.assign and when it got upgraded it broke.

@dceejay
Copy link
Member

dceejay commented Sep 12, 2018

pushed a version 2.9.9-beta to master
maybe that will load correctly for you.

@Roger53
Copy link

Roger53 commented Sep 19, 2018

Good news :

I now see "Dashboard version 2.9.9-beta started at /ui" and IE now works !!!

Coming days I will upgrade all my node-reds and see if they all work.

I hope that the other guys above can also confirm that their problems are solved.

@dceejay
Copy link
Member

dceejay commented Sep 19, 2018

will push out 2.9.9 to npm probably later this week - so everyone can get more easily.

@Roger53
Copy link

Roger53 commented Sep 19, 2018

Yes, I had to add git, 64 libs and 50MB to my image :-)

@dceejay
Copy link
Member

dceejay commented Sep 19, 2018

errrr - hmm - apologies for that ... maybe leave the others if you can wait.

@Roger53
Copy link

Roger53 commented Sep 19, 2018

No problem for me man, just poking you a bit to quickly release, so others can test also :-)
Changing releases with docker is not an issue at all.

If you dont use docker, you really have a look !

Rolling out a new version for me is just building a new image (automated), and then changing 1 string (tag) in a bash script and the new docker image is started. If it fails, again just changing a string and we are running the previous version docker image again. Ideal.

Once you pushed out the final release, I just upgrade to a new docker image, hardly any work, certainly compared with the traditional Linux way.

I love docker as you can imagine, cant live without it anymore.

@Roger53
Copy link

Roger53 commented Sep 19, 2018

Tested all dashboard variants I use (not all node-reds machines yet, but all remaing have the same dashboard code), all look fine.

@dceejay dceejay closed this as completed Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants