GithubHelp home page GithubHelp logo

Comments (8)

WayneStilwell avatar WayneStilwell commented on May 3, 2024 4

As described in the linked issue, you can temporarily add this to your package.json if you're using yarn:

  "resolutions": {
    "@types/mime": "^3.0.4"
  }

@types/express depends on @types/serve-static, which is pulling the latest version of @types/mime (v4). Mime v4 includes its types, so the @types/mime package is no longer needed. And is deprecated in v4 (as of yesterday).

This PR for @types/serve-static appears to set the appropriate version of @types/mime. Once that's merged and released, you should be able to remove the code above.

from nest.

micalevisk avatar micalevisk commented on May 3, 2024 1

indeed

I guess there's something wrong with the dependencies of @nestjs/[email protected]

v10.3.1 went fine, so you can use it for now

npx @nestjs/[email protected] new project-name
cd project-name
# to upgrade packages
ncu -u

from nest.

micalevisk avatar micalevisk commented on May 3, 2024

actually, the error exists on @nestjs/[email protected] as well due to Yarn(?)

Using NPM went fine

And seems to be related with a broken version of @types/mime (v4.0.0):

image

comparing with v3.x:

image


Same as firebase/firebase-admin-node#2512

from nest.

rdev32 avatar rdev32 commented on May 3, 2024

actually, the error exists on @nestjs/[email protected] as well due to Yarn(?)

Using NPM went fine

And seems to be related with a broken version of @types/mime (v4.0.0):

image

comparing with v3.x:

image

Same as firebase/firebase-admin-node#2512

Using npm instead of yarn worked for me. is a workaround but the bug is still there :(
Considering nest supports yarn and pnpm this is a bummer

from nest.

cosigyn avatar cosigyn commented on May 3, 2024

I am in a nest.js monorepo, I just wanted to add that I am experiencing this in non-nest related packages too,

{
  "name": "api-types",
  "main": "src/index.ts",
  "scripts": {
    "compile": "swc src --out-dir dist"
  },
  "dependencies": {
    "@prisma/client": "5.10.2",
    "@ts-rest/core": "^3.36.0",
    "zod": "3.21.1",
    "tsconfig": "workspace:*"
  },
  "devDependencies": {
    "typescript": "^5.4.3"
  }
}

from nest.

julienfdev avatar julienfdev commented on May 3, 2024

This is indeed what happened, absolutely not related to Nest indeed :
https://www.npmjs.com/package/@types/mime?activeTab=versions

Still baffling to me that this can happen and trash half the CI/CDs on the internet...
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/serve-static/package.json

Thanks @WayneStilwell for the workaround, this is infuriating.

from nest.

rdev32 avatar rdev32 commented on May 3, 2024

I don't want to bother but for educational purposes. Can I ask why the package.json build from the stackblitz site is different from what nest/cli generates? Also why does it work on npm but not on yarn or pnpm? It is clear to me that locking @types/mime solves the issue but out of curiosity does this mean npm takes frozen modules?

from nest.

micalevisk avatar micalevisk commented on May 3, 2024

that was fixed by now.

npx @nestjs/cli@latest new project-name
# select yarn
cd project-name
yarn start # working as expected

from nest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.