jina-ai / dashboard

Interactive UI for analyzing Jina logs, designing Flows and viewing Hub images
https://dashboard.jina.ai
Apache License 2.0
118 stars 60 forks source link

start-dashboard script error on Windows #147

Closed rjgallego closed 3 years ago

rjgallego commented 3 years ago

Describe the bug Running npm run start-dashboard script produces an error on Windows when trying to run REACT_APP_TARGET=dashboard

Have you solved it? If so, let us know how! Windows has to use the SET command to set environment variables. Below script works on my machine for starting the dashboard.

"start-dashboard": "SET \"REACT_APP_TARGET=dashboard\" && react-scripts start"

Thinking this command could be added to the package.json file as a separate script, something like "start-dashboard_win".


Screenshots and logs

Capture
Roshanjossey commented 3 years ago

Thank you for opening this bug and your suggestion to solve it @rjgallego :+1:

I'll try this command on linux. Ideally, we would like to have a single script that runs both on windows an *nix OSes.

DavidSanwald commented 3 years ago

https://www.npmjs.com/package/run-script-os

but since it's coming from me, you better think twice about using it. @hanxiao was always been worried about the negative impact of neurodiversity on jina ai, so I don't know :P

Roshanjossey commented 3 years ago

@DavidSanwald, thank you for your suggestion. I'll checkout run-script-os. Initially I had cross-env in mind to solve this.

Meanwhile, @rjgallego, I've created a branch with a temporary solution for this. Please try it out and tell me if it works for you. You can pull my changes with the following commands.

git checkout -b Roshanjossey-fix/start-dashboard-error-on-windows master
git pull https://github.com/Roshanjossey/dashboard.git fix/start-dashboard-error-on-windows

If we see a pattern of these problems repeating, I'll spend some time to try and use one of the packages suggested above.

rjgallego commented 3 years ago

@Roshanjossey I pulled your branch, the start-dashboard script brings up the dashboard but it's producing the below syntax error:

image

Roshanjossey commented 3 years ago

@rjgallego, this will happen if the major versions of @emotion/react @emotion/core and @emotion/styled aren't the same. I've seen this when @emotion/react version was 11.x.x when @emotion/core version was 10.x.x.

Please try running npm install

I'll check package-lock.json on my branch to see if versions are correct.

Roshanjossey commented 3 years ago

I checked package-lock.json and versions looks alright. Make sure you run npm install

rjgallego commented 3 years ago

Thanks, that fixed it. I'm able to run the dashboard with the same start-dashboard script now.

Roshanjossey commented 3 years ago

Thank you for your feedback @rjgallego.

149 is merged. Closing.