Errors with Electron

I have an older app from NSB 7 that I’m attempting to bring up to date in NSB 8 and create an Electron desktop app version.

I’m on a Mac with Big Sur OS, have installed Appstudio, and my app opens and runs okay in the browser without errors. However when I try to Run desktop app using Electron I get “Uncaught ReferenceError: Slider is not defined line 1387 column 3”.

I also get a number of “Uncaught TypeError: Cannot read properties of undefined( reading’2’) line xxxx column xx.” in different screens although the app is somewhat functional in between this error messages.

the logs just show a ton of "JFormat - Error - Toolbox/Project Bug!Fix Me… no attribute isdigit

I know one error can sometimes causes others, but not sure where I should be looking or if there is some setting/configuration that might be wrong. I should mention the project uses Bootstrap 3 extensively.

Any suggestions would be much appreciated

Electron gets updated fairly frequently. Try making a new project with AppStudio. Copy the contents (from Project Properties) of ElectronMain.js and package.json from the new project, and paste them into the same fields on your old one. (If you’ve made any customizations to those fields, remember to do those over again).

That should at least make sure everything is up to date.

So I tried that and copied the contents from a new project to my old project and unfortunately it did not work, still getting the errors.

Could you zip your project and send it to me? I’ll give it a try here.

I got the same error.

I checked the Bootstrap-slider repo. You’re not the first to have this issue. Here it is, with a possible solution:

oh okay, I will try that. Do you know where i would put their solution javascript code into?

Also, is it still not possible to mix BS3 elements with BS4? I would eventually like to update everything to BS4 but I do not want to start from scratch creating everything all at once, as it would be a lot of work.

No, Bootstrap 3 and Bootstrap 4 controls cannot coexist in the same project. It’s probably time to switch to Bootstrap 4 - it was released 4 years ago.

There is a Framework Converter which does most of the work of conversion for you. Have you given that a try?

I haven’t messed with the code which is suggested in the issue I linked to - Bootstrap 3 is considered obsolete in AppStudio. However, you may be able to do something similar in extraHeaders in Project Properties.

I did use a much earlier version of the converter to go originally from JQM to BS 3, which helped a lot but still a lot of work. I didn’t realize it had been upgraded for 3 to 4. I will try it out.

I’ve been out of active development for well over 2 years and just trying to get back into it. This was back in Phonegap days. so many elements to update now, I will see what I can get going in the short term and then go from there. Thanks for the help I will let you know if the Electron code fixes the immediate issue.

Unfortunately I have tried the code suggested in the post but it does not correct the problem. I was able to update using the Framework converter to Bootstrap 4 controls, but the did not correct the problem (with or without the code).

I have removed the one Slider control in the app, and everything else works okay, so I am going to leave it out for now rather than spend too much time trying to fix this.

I see JqWidgets have a slider control, so I might looking that. However it is not in the current toolbox. Is there a simple way to add the control for use in NSB?

I tried the Slider sample from AppStudio. It has the same problem. We see if there is a fix. If there is, it should help you as well.

We’ve got a fix. Are you on Mac or Windows? I’ll send you a test build to try out.

Oh that would be great to try. I am on Mac.

The file has been sent to you directly.

That fixes the problem it works correctly now without errors. Thank you!

Thanks for the good news. Keep using the beta - the next release will have this change, so update when it is released.