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

npm run build fails with typescript type error and missing dependencies #98

Open
mmikrut opened this issue Dec 26, 2024 · 1 comment
Open

Comments

@mmikrut
Copy link

mmikrut commented Dec 26, 2024

Describe the bug
docker-compose up --build command is failing during the TypeScript build step, primarily due to type incompatibility issues and missing dependencies.

example:

git clone [email protected]:visheshrwl/Uber-like.git                               
[...]

ideapad:~/Dev$ cd Uber-like/
ideapad:~/Dev/Uber-like$ npm install

[...]

ideapad:~/Dev/Uber-like$ docker-compose up --build
WARN[0000]  Dev/Uber-like/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Building 0.0s (0/1)                                                                        docker:default
[+] Running 0/1
[+] Building 6.0s (10/12)                                                                      docker:default 
 => [backend internal] load build definition from Dockerfile                                             0.0s
 => => transferring dockerfile: 343B                                                                     0.0s
 => [backend internal] load metadata for docker.io/library/node:18-alpine                                2.2s 
 => [backend internal] load .dockerignore                                                                0.0s
 => => transferring context: 2B                                                                          0.0s
 => [backend builder 1/6] FROM docker.io/library/node:18-alpine@sha256:6eb9c3d9bd191bd2cc6ce7ec3d5ec4c2  0.0s
 => [backend internal] load build context                                                                0.0s
 => => transferring context: 229.22kB                                                                    0.0s
 => CACHED [backend builder 2/6] WORKDIR /app                                                            0.0s
 => CACHED [backend builder 3/6] COPY package*.json ./                                                   0.0s
 => CACHED [backend builder 4/6] RUN npm install --only=production                                       0.0s
 => CACHED [backend builder 5/6] COPY . .                                                                0.0s
 => ERROR [backend builder 6/6] RUN npm run build                                                        3.7s 
------                                                                                                        
 > [backend builder 6/6] RUN npm run build:                                                                   
0.252                                                                                                         
0.252 > [email protected] build                                                                                   
0.252 > tsc                                                                                                   
0.252                                                                                                         
3.667 node_modules/kafka-node/types/index.d.ts(143,3): error TS2416: Property '_write' in type 'ProducerStream' is not assignable to the same property in base type 'Writable'.
3.667   Type '(message: ProduceRequest, encoding: "buffer" | "utf8", cb: (error: any, data: any) => any) => void' is not assignable to type '(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null | undefined) => void) => void'.
3.667     Types of parameters 'encoding' and 'encoding' are incompatible.
3.667       Type 'BufferEncoding' is not assignable to type '"buffer" | "utf8"'.
3.667         Type '"ascii"' is not assignable to type '"buffer" | "utf8"'.
3.667 node_modules/type-graphql/build/typings/errors/graphql/ArgumentValidationError.d.ts(1,38): error TS2307: Cannot find module 'class-validator' or its corresponding type declarations.

To Reproduce
git clone [email protected]:visheshrwl/Uber-like.git
cd Uber-like/
npm install
docker-compose up --build

Expected behavior
build completed without errors

Desktop (please complete the following information):
Ubuntu 22.04.5 LTS Release: 22.04
node --version v18.20.5

Copy link

Hi there! 👋
Thank you for opening your first issue in this project! We truly appreciate your effort in making this repository better. Your feedback and contributions are invaluable to us. If you have any questions or need any assistance, don't hesitate to ask. Welcome aboard, and happy contributing! 🚀

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

No branches or pull requests

1 participant