Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Error in eval(parse(text = text, keep.source = FALSE), envir) #428

Open
yyangdii opened this issue Feb 9, 2021 · 10 comments
Open

Error in eval(parse(text = text, keep.source = FALSE), envir) #428

yyangdii opened this issue Feb 9, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@yyangdii
Copy link

yyangdii commented Feb 9, 2021

I'm a newbie trying to build a Shiny app using electricShine on Win10. The app is already structured as a golem package. While running the following electrify code:

`buildPath <- tempdir()

my_package <- "~/mygolem/"

electricShine::electrify(app_name = "my_app",
semantic_version = "1.0.1",
build_path = buildPath,
mran_date = NULL,
cran_like_url = "https://cran.r-project.org",
function_name = "run_app",
local_package_path = my_package,
package_install_opts = list(type = "binary"),
nodejs_path = file.path("C:/User/Documents/R/win-library/4.0/electricShine/nodejs/node-v12.16.2-win-x64"),
run_build = TRUE)`

This error message occurs:

Finshed: Installing your Shiny package into electricShine framework Successfully created C:/User/AppData/Local/Temp/Rtmp4wy0fK/my_app/package.json Fehler in eval(parse(text = text, keep.source = FALSE), envir) : Objekt 'platform' nicht gefunden

The last line means "object 'platform' not fund".

Since I don't have any object named platform in my app code, I'm totally lost. Could you please help? Thanks a lot!

@chasemc chasemc added the bug Something isn't working label Feb 10, 2021
@chasemc chasemc self-assigned this Feb 10, 2021
@chasemc
Copy link
Owner

chasemc commented Feb 10, 2021

It's a bug that needs to be fixed. Should work if you don't specify nodejs_path

For me:
{glue} variables missing:

glue::glue("node-{nodejs_version}-{platform}-{arch}"),

@drchriscole
Copy link

I get the same error on Windows 10 R 4.0.3 and I haven't specified the nodejs_path.

`buildPath <- tempdir()

electricShine::electrify(app_name = "My_App",
short_description = "My demo application",
semantic_version = "1.0.0",
build_path = buildPath,
mran_date = NULL,
cran_like_url = "https://cran.r-project.org",
function_name = "run_app",
git_host = "github",
git_repo = "chasemc/demoApp@8426481",
local_package_path = NULL,
package_install_opts = list(type = "binary"),
run_build = TRUE)`

@hotakamaeda
Copy link

hotakamaeda commented Feb 25, 2021

Hi. I got the same error. Windows 10 R 4.0.4

@chasemc
Copy link
Owner

chasemc commented Feb 26, 2021

Confirmed, will work on fix

@py9mrg
Copy link

py9mrg commented Mar 1, 2021

Hello @chasemc - @hotakamaeda has a solution for this. If you manually set platform <- "win" and arch <- "x64" before running electrify then there's no platform error. But also see my comment on the webpackmerge-fix PR as that doesn't seem to have solved the merge is not a function issue - yet manually installing the corresponding webpackmerge-fix commit does, which is really weird. So I think the above people may run into that after sorting out the platform issue. HTH.

@mcmcapewell
Copy link

Hello @chasemc - @hotakamaeda has a solution for this. If you manually set platform <- "win" and arch <- "x64" before running electrify then there's no platform error. But also see my comment on the webpackmerge-fix PR as that doesn't seem to have solved the merge is not a function issue - yet manually installing the corresponding webpackmerge-fix commit does, which is really weird. So I think the above people may run into that after sorting out the platform issue. HTH.

Thanks for this. After manually installing webpackmerge-fix the demo app at "chasemc/demoApp@8426481" installs and runs fine. However, downloading the exact same repo and trying to install locally results in an app that loads infinitely with the error message
"Uncaught Exception: Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_common.js:200.27)" in a pop-up box. In addition, I can't seem to get any golem Shiny apps to work at all.

Any known fix for the issue? Is this a known issue with the local installer and not the Github installer?
Cheers

@py9mrg
Copy link

py9mrg commented Mar 29, 2021

@mcmcapewell not sure about the error message sorry, looks like something to do with nodejs but I know next to nothing about that. Edit - I've never had an issue with installing locally FWIW. If you explain exactly what you've tried I can copy it my end if I get the time.

If I remember right, golem apps won't work out of the box any more. Long story short, I think the problem is that golem have changed how they initiate their apps since the eS package was written. I don't fully understand what but when I was starting out with eS I whittled down the potential causes to changes in what the run_app function does in golem now. If you want to use golem you'll need to change that function to the more simple style you see in the eS demoApp (or vice versa). Otherwise forget about golem for now. I think @chasemc plans to update eS to be compatible with golem again, but it might be a big job so finding the time is not easy I imagine.

@mcmcapewell
Copy link

@py9mrg Thanks for your info - didn't realise that about golem. The ECONNRESET issue with hanging loading screen was because I was using an old version of run_app in the demoApp, and selected the wrong version of the commit I was trying to get a hold of (@8426481, located at @84264811068ca354ba66acbe2216f9e5586bfd45 which I struggled to find).

I've basically been replicating what you've done in #317 to start with the working demoApp and build up from there. I realise you've some valuable advice about Depends/Imports and the NAMESPACE so I'll dilligently follow that in your post. Cheers.

@chasemc
Copy link
Owner

chasemc commented Apr 4, 2021

@nevilamos
Copy link

I am also getting this error when trying to create the demo app on windows10
using the verbatim code from the example
library(electricShine)
buildPath <- tempdir()

electricShine::electrify(app_name = "My_App",
short_description = "My demo application",
semantic_version = "1.0.0",
build_path = buildPath,
function_name = "run_app",
git_host = "github",
git_repo = "chasemc/demoApp@8426481",
package_install_opts = list(type = "binary",
dependencies = c("Depends",
"Imports")
),
cran_like_url = "https://cran.r-project.org"
)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants