R
Railwayโ€ข15mo ago
Chris ๐Ÿ’™

Hello, i have a deploy error that i don't have before

Hello, my last deploy was a year ago, i have make a litle update and now the nodejs projet give my a path error for a file that i don't have touch, i have try to redeploy the deploy before my update but same error, my error :
throw err;

^

Error: Cannot find module '../../index.js'

Require stack:

- /usr/src/app/src/handlers/events/event.ts

- /usr/src/app/src/client.ts

- /usr/src/app/src/index.ts
throw err;

^

Error: Cannot find module '../../index.js'

Require stack:

- /usr/src/app/src/handlers/events/event.ts

- /usr/src/app/src/client.ts

- /usr/src/app/src/index.ts
20 Replies
Percy
Percyโ€ข15mo ago
Project ID: 152ff848-e90d-48e6-9bfd-f487495da195
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
152ff848-e90d-48e6-9bfd-f487495da195
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
GitHub
Comparing master@{1day}...master ยท Arcoz0308/BSE-bot
Le bot discord de BSE. Contribute to Arcoz0308/BSE-bot development by creating an account on GitHub.
Medim
Medimโ€ข15mo ago
It runs fine locally?
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
Yes And the old build buildet a moth ago that i have try to rebuild for continue maintain my bot, but crashed to
Medim
Medimโ€ข15mo ago
My guess is that theres a problem with u path alias Look at the path the error generated /usr/src/app/src/ double src and in ur tsconfig.json u got a "$core/*": [ "./src/*" ]
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
Is work dir
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
GitHub
BSE-bot/Dockerfile at master ยท Arcoz0308/BSE-bot
Le bot discord de BSE. Contribute to Arcoz0308/BSE-bot development by creating an account on GitHub.
Medim
Medimโ€ข15mo ago
If u remove the Dockerfile and set the start command in the service to npm run start:prod does it work?
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
I have dependences require node v19 So i don't can run without dockerfile
Medim
Medimโ€ข15mo ago
You can set a NIXPACKS_NODE_VERSION = 19 env var to set the node version
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
19 is added of support ?
Medim
Medimโ€ข15mo ago
ye (i think) nvm it doesn't, i thought my app was running on 19 but it runs on 18 I had the same issue you are having, but i can't remember exactly what i did to fix it
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
https://discord.com/channels/713503345364697088/1136776022012985504 My last post have say to use dockerfile for fix it
Medim
Medimโ€ข15mo ago
if brody said it, better keep that dockerfile there
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
But the thing that are cringe, that the same deploy run one moth ago but not now
Brody
Brodyโ€ข15mo ago
what I didn't write that dockerfile
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
Yes, but you have say my to use a dockerfile I have write it same, and one moth ago he was work without problem
Brody
Brodyโ€ข15mo ago
why do you have your lock file in the gitignore
Chris ๐Ÿ’™
Chris ๐Ÿ’™OPโ€ข15mo ago
I use pnpm in dev, and is autogenered gitignore
FROM node:19-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

COPY . /app
WORKDIR /app

FROM base AS prod-deps
RUN pnpm install --prod --frozen-lockfile

FROM base AS build
RUN pnpm install --frozen-lockfile
RUN pnpx prisma generate
RUN pnpm run build

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/out /app/out
EXPOSE 8000
CMD [ "pnpm", "run", "start:prod" ]
FROM node:19-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

COPY . /app
WORKDIR /app

FROM base AS prod-deps
RUN pnpm install --prod --frozen-lockfile

FROM base AS build
RUN pnpm install --frozen-lockfile
RUN pnpx prisma generate
RUN pnpm run build

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/out /app/out
EXPOSE 8000
CMD [ "pnpm", "run", "start:prod" ]
fix, now i use pnpm, swc and build and run, after somes hours to try to run it correctly
Want results from more Discord servers?
Add your server