ArduPilot / ArduPilot/UAVLogViewer

Latest docker build instructions fail to run `npm run dev`

Open
#454 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
258
Forks
296
PR merge metrics
No merged PRs in 30d

Description

Latest instructions mention running

```
docker run -e VUE_APP_CESIUM_TOKEN= -it -p 8080:8080 -v ${PWD}:/usr/src/app /uavlogviewer
```

cause the `npm run dev` at the end of the build to fail with an error:

```
> tlogviewer@1.0.0 dev
> node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js --host 0.0.0.0 --progress --config build/webpack.dev.conf.js

node:internal/modules/cjs/loader:1215
throw err;
^

Error: Cannot find module '/usr/src/app/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
at Module._load (node:internal/modules/cjs/loader:1043:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:164:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
```

The problem seems to be bind-mount of source directory to `/usr/src/app` which masks the `node_modules` folder inside the container (at least on Windows).

As a fix one can mount a separate volume for `node_modules` like this:

```
docker volume create uavlogviewer-node_modules

docker run -e VUE_APP_CESIUM_TOKEN= -it -p 8080:8080 -v ${PWD}:/usr/src/app -v uavlogviewer-node_modules:/usr/src/app/node_modules /uavlogviewer
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the documentation containing the Docker command shown in the issue and reproduce it, then run `npm run dev` to confirm the failure and test the separate `node_modules` volume command. Done means the documented command starts the webpack dev server successfully and the instructions explain the required volume mount.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript
Domain
devops, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.