ficonsulting / RInno

How to install local shiny apps
https://ficonsulting.github.io/RInno/
Other
308 stars 67 forks source link

Microsoft JScript compilation error 800A03EE. #44

Open hooty668 opened 6 years ago

hooty668 commented 6 years ago

I had an error when opening the app. it seems to have trouble running json2.js. This line in particular:
j = eval('(' + text + ')'); i ran the example and everything was fine. Any ideas on what is happening?

image

hooty668 commented 6 years ago

It looks like when i print '(' + text + ')' i get:

image

Which seems as though it is duplicating.

Dripdrop12 commented 6 years ago

I've seen that error on older versions of Windows. Can you run Sys.info() and provide the results here? Thanks!

hooty668 commented 6 years ago

"Windows" "7 x64" "build 7601, Service Pack 1" "x86-64"
I got around it by placing it in my public folder. The problem I am having now is sourcing functions in my ui. I have R functions that I placed in my app directory and I source them in my ui. Is there any particular your suppose to do this?

Dripdrop12 commented 6 years ago

All the files in your app_dir should be installed along with your ui.R and server.R files. It respects any directories you create, so you can use relative references to source those functions into your app. For example, if my_func is in "app_dir/extras", you should be able to source it with: source("extras/my_func.R").

For details, check out ?RInno::files (?RInno::files_section for >= v0.2.0)

hooty668 commented 6 years ago

I figured out what was going on with the R Functions, however i am getting the original problem again. Originally I could choose the destination folder to be Public (during installation) and that fixed the problem, Now it doesn't give me that option when I go through the RInno_installer in the app. Any Ideas?

Dripdrop12 commented 6 years ago

That option is controlled by the default_dir argument of create_app (or setup/setup_section). The installer should always give you the option to change the default installation drive. For more information, check out the documentation of default_dir in ?RInno::setup (or ?RInno::setup_section for >= v0.2.0).

ghost commented 6 years ago

I am getting the same error when trying to open an app: Line: 504 Char: 18 Error: Expected ')' Code: 800A03EE Source: Microsoft JScript compilation error

Here is the result of Sys.info():

sysname "Windows" release "7 x64" version build 7601, Service Pack 1" machine "x86-64"

peaceengine commented 6 years ago

I am getting the exact same error using Windows 10: Line: 504 Char: 18 Error: Expected ')' Code: 800A03EE Source: Microsoft JScript compilation error

Here is the result of Sys.info(): Windows

= 8 x64 build 9200 DESKTOP-5SUMVE0 x86-64

Any help greatly appreciated! Thank you,

Antony

biometrica commented 6 years ago

Gentleman, Has this issues been resolved? I obtain an identical to other posters above, following the example provided on the Rinno home page: install.packages("RInno") require(RInno) RInno::install_inno() example_app(app_dir = "app") create_app(app_name = "myapp", app_dir = "app") compile_iss()

The error is given as follow: Error: Expected ')' Code: 800A03EE Source: Microsoft JScript compilation error

This package has a lot of promise, if the error can be resolved!

peaceengine commented 6 years ago

Unfortunately, not. It's a shame as I'd love to use R to make distributable programs. I need Rinno because the files it has to load up are just too big to use for web. I really don't want to move to Python. Hope it can be solved! ))

biometrica commented 6 years ago

@peaceengine Thanks for the update. I ended up programming a solution using: https://www.r-bloggers.com/deploying-desktop-apps-with-r/

However, the above methodology is not as elegant as what Rinno seems to offer, and generates a hefty sized package to distribute to the user. @Dripdrop12 please update users when this is resolved and I'll be sure to retest.

chasemc commented 6 years ago

I am not able to reproduce this error, and don't know java but you those of you having issues might try replacing in json2.js with this version and reporting if you still get the error.

J-Sieber commented 6 years ago

I have the same issue. I just tried replacing the json2.js file but it did not solve the issue.

Dripdrop12 commented 6 years ago

It looks like IE does some syntax checking on JScript (which it wrongly recognizes as Java Script), and it expects a ")" in that possition... here is a link that may help in one-off situations.

Is this also happening for people using Chrome?

Regardless, the long term fix is to remove all browsers from the framework by creating a stand-alone UI #21 (thanks @trybik for the inspiration here).

J-Sieber commented 6 years ago

I use Chrome but also have IE installed. I followed the instructions from the link but still have the issue. Using Windows 10.

peaceengine commented 6 years ago

I am using Windows 10 and tried with Firefox, Chrome and Edge.

jackliu333 commented 6 years ago

Is there any update on this thread? I'm also facing the same issue.

Dripdrop12 commented 6 years ago

I'm not able to reproduce the error. I've tried it on multiple machines with different configurations, but never gotten it. If someone can figure out what is causing it on their machines, I'd be happy to address it!

akorejwa commented 6 years ago

I get this problem with both my own project and the demonstration example. I have tried it on win 10 and win 7. I have set the default browser to firefox and chrome on the win 10 machine. I tried it with 32 bit and 64 bit R. I don't know if this matters, but R is installed in the Documents folder instead of programs folder and did all programming in RStudio.

Dripdrop12 commented 6 years ago

Is your R library in Documents (that is normal)? Or is the rscript.exe installed there as well?

akorejwa commented 6 years ago

I take back what I said earlier. R is in Programs/, the library is in Documents/. (I didn't see an R folder in the x86 Programs folder and assumed the bin/ was under Documents/R/).

cwg940 commented 6 years ago

I was having the same issue. I included all the library dependencies on the ui.R file, and seems to work now.

J-Sieber commented 6 years ago

I think I have narrowed it down to adding the closing part in server.R. Once I add the session section:

function(input, output, session) {

  output$distPlot <- renderPlot({

    # generate bins based on input$bins from ui.R
    x    <- faithful[, 2] 
    bins <- seq(min(x), max(x), length.out = input$bins + 1)

    # draw the histogram with the specified number of bins
    hist(x, breaks = bins, col = 'darkgray', border = 'white')

  })

  session$onSessionEnded(function() {
    stopApp()
    q("no")
  })

}

Then I start getting this error. It works before adding in the session section but it does not close properly.

segoldma commented 6 years ago

@J-Sieber I started experiencing this error message when adding the onSessionEnded function to my server function as well. Hope this helps

natewells25 commented 5 years ago

Has this been resolved yet? I am stuck at this point.

stitam commented 5 years ago

I have managed to reproduce the bug and also to get rid of it. When I followed the minimal example (https://cran.r-project.org/web/packages/RInno/vignettes/Introduction.html) it ended up with the error message. But when I also specified the arguments include_R = TRUE and include_Rtools = TRUE) in create_app() it did not end up with the error message. This also worked for my own app. A possible clue: the installer mentioned that the Rtools version on my computer is different from the one in the installer. I forced the version within the installer. Does this help?

Sys.info(): $sysname [1] "Windows" $release [1] ">= 8 x64" $version [1] "build 9200" $machine [1] "x86-64"

tobiasblasberg commented 5 years ago

@stitam : I am facing the same issues and including include_R = TRUE and include_Rtools = TRUE does not resolve the issue for me.

Unfortunately none of the other approaches for resolving worked neither.

mxfeinberg commented 5 years ago

@tobiasblasberg @stitam

Has any progress been made toward solving this issue? I've attempted builds on Windows 7 and Windows 10 and I've used the include_R and include_RTools flag but I'm still experiencing the same error.

peaceengine commented 5 years ago

I literally learnt Python because I couldn’t do this in R. Such a shame R doesn’t have this ability. Hope things change.

From: Max Feinberg notifications@github.com Sent: 07 September 2019 21:31 To: ficonsulting/RInno RInno@noreply.github.com Cc: Antony Butts antonybutts@me.com; Mention mention@noreply.github.com Subject: Re: [ficonsulting/RInno] Microsoft JScript compilation error 800A03EE. (#44)

@tobiasblasberg https://github.com/tobiasblasberg @stitam https://github.com/stitam

Has any progress been made toward solving this issue? I've attempted builds on Windows 7 and Windows 10 and I've used the include_R and include_RTools flag but I'm still experiencing the same error.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ficonsulting/RInno/issues/44?email_source=notifications&email_token=ACVGCFVMDIFGHX5Y2UURWXLQIQFRVA5CNFSM4EKJTX72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6FBWTA#issuecomment-529144652 , or mute the thread https://github.com/notifications/unsubscribe-auth/ACVGCFXHNE5VXTDIX6PCNIDQIQFRVANCNFSM4EKJTX7Q . https://github.com/notifications/beacon/ACVGCFRGCTVEIAJ6I2HRRRTQIQFRVA5CNFSM4EKJTX72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6FBWTA.gif

mxfeinberg commented 5 years ago

@Dripdrop12 do you have any input?

astimaka commented 5 years ago

Tengo un problema similar, pero creo que es anterior pues cuando instalo la aplicación me entrega un mensaje de error

rizwanmeer commented 5 years ago

I had an error when opening the app. it seems to have trouble running json2.js. This line in particular: j = eval('(' + text + ')'); i ran the example and everything was fine. Any ideas on what is happening?

image

just Right Click on file and open with VS COde

Wladimir-Sanyer commented 3 years ago

Is there any solution? I get the same error

imransadik commented 3 years ago

I get the same error

fairking commented 2 years ago

It is because your all .js files are associated with Windows Script Host. So something is executing js files without pointing it to node.js. To fix the issue find any JS file right click -> Open With -> Choose another app -> Tick checkbox "Always use this app" -> and find you nodejs (usually it is C:/ProgramFiles/nodejs/node.exe). The error should dissapear.

image

Also to execute js files in other apps we rather should use node myscript.js instead of myscript.js. https://stackoverflow.com/a/39311363/1143349

jedieaston commented 2 years ago

Also to execute js files in other apps we rather should use node myscript.js instead of myscript.js.

That's the real issue, Windows doesn't have something like the shebang line on *nix. Scripts should be executed by opening their interpreters explicitly instead of praying the user has set their file handlers correctly.