build modern web

Manuel Suárez3 years ago

Hi Anton,
I would like to know if you can guide me, since I modified the modern version of traccar web and compiled with the command npm run build and it ended successfully, but when copying my build traccar it does not load.

https://ibb.co/FhvyFX1

And only one item was added to the account menu

https://ibb.co/SPw4Rs6

Anton Tananaev3 years ago

Did you do npm run build_release?

Manuel Suárez3 years ago

if you use the command npm run build

Anton Tananaev3 years ago

Based on the screenshot it seems like you're using the app in the subfolder, which means you need to use "build_release".

Manuel Suárez3 years ago

I get this message when using npm run build_release

PS C:\Users\Manuel\Desktop\modern\traccar-web\modern> npm run build_release

> traccar@5.0.0 build_release    
> PUBLIC_URL=/modern/ craco build

"PUBLIC_URL" is not recognized as an internal or external command,
executable program or batch file.
Anton Tananaev3 years ago

Looks like environment variables are not supported on Windows in the same way. You might need to adjust the script.

Basically you need to set the PUBLIC_URL environment variable:

https://create-react-app.dev/docs/using-the-public-folder/

Manuel Suárez3 years ago

thanks i check it

Fareed Qureshi2 years ago

Any solution I am also facing same issue, tried to run my project in root and sub folder but only one page is working.
https://www.traccar.org/forums/topic/new-version/#post-72730