highcharts / highcharts/node-export-server

Error: ENOENT: no such file or directory, open '/app/dist//../templates/template.html'

Open
#520 3 comments 0 reactions 0 assignees View on GitHub
environment issue
Dominant language
JavaScript
Stars
369
Forks
266
PR merge metrics
No merged PRs in 30d

Description

#### Expected behaviour
running successfully

#### Actual behaviour
```
Error: ENOENT: no such file or directory, open '/app/dist//../templates/template.html'
at Object.openSync (node:fs:600:3)
at Object.readFileSync (node:fs:468:35)
at 31415 (/app/dist/server.min.js:612785:20589)
at __webpack_require__ (/app/dist/server.min.js:649632:42)
at 92448 (/app/dist/server.min.js:313917:18)
at __webpack_require__ (/app/dist/server.min.js:649632:42)
at 49719 (/app/dist/server.min.js:314180:22)
at __webpack_require__ (/app/dist/server.min.js:649632:42)
at 48862 (/app/dist/server.min.js:313550:29)
at __webpack_require__ (/app/dist/server.min.js:649632:42)
at 66611 (/app/dist/server.min.js:304200:16)
at __webpack_require__ (/app/dist/server.min.js:649632:42)
at 80341 (/app/dist/server.min.js:313367:18)
at __webpack_require__ (/app/dist/server.min.js:649632:42)
at /app/dist/server.min.js:649729:37
at Object. (/app/dist/server.min.js:649731:12) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/app/dist//../templates/template.html'
}
```

#### Reproduction steps
1. install module in app
```
yarn add highcharts-export-server
```
1. build app and bundling to `server.min.js`
1. run server.min.js
1. see error.

dockerfile setting
```
FROM node:18.12.1-alpine3.15 as base

RUN apk add --no-cache \
chromium

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

FROM base as builder
WORKDIR /app
COPY .npmrc package.json yarn.lock ./
RUN yarn --non-interactive
COPY . .

## Build backend
RUN yarn build

FROM base

WORKDIR /app
COPY --from=builder app/build dist

RUN npm install pm2 -g
EXPOSE $PORT

CMD ["pm2-runtime", "dist/server.min.js"]
```

when i run in dev env with node_modues, it works well.
dev dockerfile
```
FROM node:18.12.1-alpine3.15 as base

RUN apk add --no-cache \
chromium

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

WORKDIR /app
COPY .npmrc package.json yarn.lock tsconfig.json ./
RUN yarn --non-interactive

CMD ["npx", "ts-node-dev", "--inspect", "-r", "tsconfig-paths/register", "./src/index.ts"]
```

is bundling(building) with highcharts-export-server not available?
should i set the highcharts-export-server to stand alone outside the BE app?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.