Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
develtype opened this issue May 9, 2024 · 1 comment

Comments

@develtype
Copy link

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.<anonymous> (/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
    
  2. build app and bundling to server.min.js
  3. run server.min.js
  4. 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?

@jszuminski
Copy link
Contributor

Thanks for reporting @develtype!


Internal note: related to this issue: #348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants