building from source

You k2 years ago

Hello,

I'm trying to build web interface from source everything went well until the step where I have to execute the command serve -s build so i got this error :

root@xxx-virtual-machine:/home/xxx/Downloads/traccar-web-master# serve -s build
file:///usr/local/lib/node_modules/serve/build/main.js:130
      url.port = url.port ?? "3000";
                           ^

Any insights please ?

You k2 years ago
root@xxx-virtual-machine:/home/xxx/Downloads/traccar-web-master# serve -s build
file:///usr/local/lib/node_modules/serve/build/main.js:130
url.port = url.port ?? "3000";
^
SyntaxError: Unexpected token '?'
Anton Tananaev2 years ago

What is serve and how is it related to the official Traccar? Why are you not following the documentation?

You k2 years ago

hello,

Thanks for your reply, i folloowed the main documentation here https://www.traccar.org/build-web-app/
after running npm run build (successfully) the system told me to run npm install -g serve
and then serve -s build

Please what should i do now ?

Anton Tananaev2 years ago

Are you trying to build the modern app or the legacy app? The modern app is in the modern subfolder, as the documentation you linked clearly states.

You k2 years ago

Yes modern app, here some details about steps i followed :

root@xxx/home/xxx/Downloads/traccar-web-master/modern# npm run build

> traccar@5.3.0 build
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  898.75 kB  build/static/js/main.9dbea865.js
  17.19 kB   build/static/css/main.967cebd1.css

The bundle size is significantly larger than recommended.
Consider reducing it with code splitting: https://goo.gl/9VhYWB
You can also analyze the project dependencies: https://goo.gl/LeUzfb

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  serve -s build

Find out more about deployment here:

  https://cra.link/deployment
Anton Tananaev2 years ago

It is compiled successfully, as the output says.

You k2 years ago

Yes, i replaced the content of modern folder in my local server by the compiled one but i noticed that it doesn't take into acount the new logo still see the traccar logo

Anton Tananaev2 years ago

You cleared the cache and all the app data? If yes and still doesn't work, your customization it probably wrong.