#Issue compiling nestjs project, i receive lots of errors

54 messages · Page 1 of 1 (latest)

hard viper
#

If you just need it to compile, I think you can add skipLibCheck: true to your tsconfig compile options.

This looks like a problem with multiple versions of the same package and its types.

#

Probably an old version of types for express itself?

stuck radish
#

Hello @hard viper Thank you so much for your quick reply.

#

Let me try it and post the results to you.

#

yes probably you are right, what do i do to resolve this problem

#

i tried everything and im not a nestjs developer.

#

any help is appreciated.

hard viper
#

This is not related to NestJS at all, it's just Typescript.

Did it compile with the flag set to true?

stuck radish
#

no it didnt

#

same

#

should i remove any directories and run npm install again?

#

do you want me to share some files with you to review like package.json?

hard viper
#

Hm, I don't see anything wrong at first glance. I just checked the compatible versions for NestJS 7 and it matches.

stuck radish
#

When i run npm install i get this

hard viper
#

Did the project have a package-lock.json?

stuck radish
#

yes and i deleted it and node_modules and tried npm install

#

do you want a copy of the package-lock.json file?

hard viper
#

so the build didn't work even with the original package lock?

stuck radish
#

no it didnt.

hard viper
#

I've never seen these checks 🤔

stuck radish
#

i dont know what to do

#

been trying to resolve for 2 days now

hard viper
#

I would try unsintalling the types for the serve static module and trying the build again

stuck radish
#

what command would i use please?

#

im not familiar with nestjs or typescript at all

#

any help is appreciatd.

stuck radish
#

@hard viper any help?:)

hard viper
stuck radish
#

thank you

stuck radish
#

Hello guys hope you are all well, im still having issues not being able to nest build the project

stuck radish
#

Im getting these two errors now.

#

Thats the package.json file.

#

What's the issue?

stuck radish
#

Can someone help please?

stuck radish
#

Build on heroku now fails with the above message.

stuck radish
#

I managed to get this to work by adding .npmrc

legacy-peer-deps=true

#

My only issue now is something in the code itself which i posted above.

#

Can someone please assist?

hard viper
#

The method should always return ContentDto, as per the return type annotation, but the implementation of the method says something different. It either returns something without uid and phraseKey, which is not compatible with ContentDto, or it returns undefined, which is also totally not ContentDto.

stuck radish
#

Hi @hard viper thank you, so whats the solution here? I didnt write this app, not sure what to do.

#

attaching the two files

hard viper
#

I have no idea, I also did not write that app 😄 if you just want to get rid of the typescript error while preserving the obviously wrong behavior, just cast the result to any or put //@ts-ignore before the faulty line

stuck radish
#

This line here too