ATFutures / geoplumber

Serve geographic data from R and consume with scalable front end.

Home Page:https://atfutures.github.io/geoplumber/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Traffic example does not work

mpadge opened this issue · comments

Most of the functionality described in current README works like magic, but I get one error in trying to build and serve the traffic data example.

> gp_endpoint_from_clip()
Clipboard contents: 
------begin----
#' Serve geoplumber::traffic from /api/data
#' @get /api/data
get_traffic <- function(res) {
  geojson <- geojsonsf::sf_geojson(geoplumber::traffic)
  res$body <- geojson
  res
}
-----end-----

No warnings given.
Success.
Please restart your server: gp_plumb()

That all runs okay, then

> gp_add_geojson("/api/data")
Remember to rebuild frontend: gp_build()
Success. 
> gp_build ()
Running: npm run build

> junk@0.1.0 build [...]/junk
> react-scripts build

Creating an optimized production build...
Failed to compile.

[...]

npm ERR! code ELIFECYCLE                 
npm ERR! errno 1                         
npm ERR! junk@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!                                                     
npm ERR! Failed at the junk@0.1.0 build script.              
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
                          
npm ERR! A complete log of this run can be found in:                    
npm ERR!    ~/.npm/_logs/2018-09-18T10_25_21_657Z-debug.log 
Standard output from create-react-app above works.     
To run the geoplumber app: gp_plumb()

The error means that the following just delivers a blank screen:

> gp_plumb ()               
Starting server to listen on port 8000
Running the swagger UI at http://127.0.0.1:8000/__swagger__/

although localhost:8000/api/data does contain the expected geojson data. The output of the npm log looks like this:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm@6.4.1
3 info using node@v10.10.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle junk@0.1.0~prebuild: junk@0.1.0
6 info lifecycle junk@0.1.0~build: junk@0.1.0
7 verbose lifecycle junk@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle junk@0.1.0~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/data/mega/code/repos/atfutures/geoplumber/junk/node_modules/.bin:~/R/x86_64-pc-linux-gnu-library/3.5/nvimcom/bin:/usr/local/lib/depot_tools:~/.autojump/bin:/usr/local/lib/depot_tools:~/.autojump/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
9 verbose lifecycle junk@0.1.0~build: CWD: /data/mega/code/repos/atfutures/geoplumber/junk
10 silly lifecycle junk@0.1.0~build: Args: [ '-c', 'react-scripts build' ]
11 silly lifecycle junk@0.1.0~build: Returned: code: 1  signal: null
12 info lifecycle junk@0.1.0~build: Failed to exec build script
13 verbose stack Error: junk@0.1.0 build: `react-scripts build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:962:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid junk@0.1.0
15 verbose cwd [...]/junk
16 verbose Linux 4.18.6-arch1-1-ARCH
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v10.10.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error junk@0.1.0 build: `react-scripts build`
22 error Exit status 1
23 error Failed at the junk@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

For this one, wondering how to simulate your system config. But it is not something affected by the duplicate declaration here #32?

Can you please re-run this now that we have removed the duplicate #32 issue @mpadge? I just did and all looked good except for inconsistency of Rstudio Viewer which we are aware of.

Cool, I can no longer reproduce that error, so happy to just pretend it never happened. 😏