OpenEnergyPlatform / oeplatform

Repository for the code of the Open Energy Platform (OEP) website. The OEP provides an interface to the Open Energy Family
http://openenergyplatform.org/
GNU Affero General Public License v3.0
62 stars 19 forks source link

Building the factsheet react app raises build errors on windows. #1294

Closed jh-RLI closed 1 year ago

jh-RLI commented 1 year ago

Description of the issue

I tried to run npm install and npm run build in the /factsheet/frontend directory. When running the build command, several errors occurred. The errors relate to the script section in the package.json file.

https://github.com/OpenEnergyPlatform/oeplatform/blob/2233fe12fc6b8c8b014d0765886f20e5ad0e9b76/factsheet/frontend/package.json#L57-L60

I solved some of the errors by using mkdirp instead of mkdir, but in the end it can't find the path to the static folders for some reason (I stopped debugging at this point)

   "build": "set BUILD_PATH=../static/temp && react-scripts build && npm run build:make_dir",
    "build:make_dir": "mkdirp ../static/factsheet/css && mkdirp ../static/factsheet/js && npm run build:relocate",
    "build:relocate": "move ../static/temp/static/css ../static/factsheet/ && move ../static/temp/static/js ../static/factsheet/ && npm run build:clean",
    "build:clean": "rm -rf ../static/temp",

using my updates and run the build command again i get:

OEP_Factsheets@0.1.0 build:make_dir mkdirp ../static/factsheet/css && mkdirp ../static/factsheet/js && npm run build:relocate

OEP_Factsheets@0.1.0 build:relocate move ../static/temp/static/css ../../static/factsheet/ && move ../static/temp/static/js ../../static/factsheet/ && npm run build:clean

Das System kann den angegebenen Pfad nicht finden.

Ideas of solution

Describe possible ideas for solution and evaluate advantages and disadvantages.

Context and Environment

Workflow checklist

jh-RLI commented 1 year ago

On Windows (wsl) the temp folder includes a blank space in the name. This leads to the error when the command attempts to move files. For now i will manually copy the build files to the static/factsheet folder and move the js/ by moving the static/temp/css/ and static/temp/js/ folders there.

jh-RLI commented 1 year ago

I will close this for now. Currently, we don't provide an automated solution for windows devs. If you require guidance on how to run the react based apps that are integrated into Django on a Windows machine, get in touch with @jh-RLI.