Skip to content

Please update class-transformer dependency to the latest version #783

Closed

Description

@slavafomin

Hello!

Thank you for this great library!

However, right now it requires class-transformer@0.3.1 (exact version 0.3.1) as a peer dependency. This prevents my project from using the latest version of the class-transformer (which is 0.4.0).

This generates the following error on npm install:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @acme/project
npm ERR! Found: class-transformer@0.4.0
npm ERR! node_modules/class-transformer
npm ERR!   class-transformer@"0.4.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer class-transformer@"^0.3.1" from routing-controllers@0.9.0
npm ERR! node_modules/routing-controllers
npm ERR!   routing-controllers@"0.9.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Would you be so kind to update class-transformer dependency to the latest version?

Thanks!

Activity

  1. slavafomin commented on Oct 8, 2021

    @slavafomin
    ContributorAuthor

    The same issue is with class-validator.

    Also, it would be much easy to avoid these kind of issues if you would switch to a stable semver range (major version > 0) because it would allow to match dependencies in a more relaxed manner.

  2. SandraShklyaeva commented on Nov 22, 2021

    @SandraShklyaeva

    Dependency update sounds even more urgent because of the latest security vulnerability fixes for the following packages:
    class-validator => 0.13.2 (changelog)
    class-transformer => 0.5.0 (changelog)

  3. biton-ron commented on Dec 9, 2021

    @biton-ron

    Same issue for us, a fix will be a great help.

    Thanks!

  4. juniopereirab commented on Dec 14, 2021

    @juniopereirab

    Same problem here...

    TypeError: class transformer 1.classToPlain is not a function

  5. RatakondalaArun commented on Dec 17, 2021

    @RatakondalaArun

    Is there any workaround for this?

    I want to use exposeDefaultValues which was added in v0.3.2

  6. amellalkamel commented on Jan 25, 2022

    @amellalkamel

    +1
    this is a serious issue

  7. seblaz commented on Mar 21, 2022

    @seblaz

    Hi @NoNameProvided @attilaorosz, would you mind having a look at the pr? Thanks!

  8. zSakuraEvilz commented on Apr 9, 2022

    @zSakuraEvilz

    Is there no new update for this issue?

  9. attilaorosz commented on Apr 9, 2022

    @attilaorosz
    Member

    Seems like there are no real breaking changes in terms of class-transformer usage (I might be wrong here) so you can just update the package since it is only a peer dependency.

  10. biton-ron commented on Apr 27, 2022

    @biton-ron

    Seems like there are no real breaking changes in terms of class-transformer usage (I might be wrong here) so you can just update the package since it is only a peer dependency.

    We're working with TypeScript and we get some type differences that reflect breaking changes in the library.

  11. saschajunius commented on Jun 8, 2022

    @saschajunius

    Is there any workaround for this?

    I want to use exposeDefaultValues which was added in v0.3.2

    I just found a workaround which seems to work, you can install two versions of the same package using an alias:

    • npm install class-validator12@npm:class-validator@0.12.2
    • npm install class-transformer3@npm:class-transformer@0.3.1

    My package.json now looks like this:

            "class-transformer": "^0.5.1",
            "class-transformer3": "npm:class-transformer@^0.3.1",
            "class-validator": "^0.13.2",
            "class-validator12": "npm:class-validator@^0.12.2",
    

    Never saw that syntax before, but this is working for me.

  12. pfgallagher commented on Jun 8, 2022

    @pfgallagher

    Is there any workaround for this?
    I want to use exposeDefaultValues which was added in v0.3.2

    I just found a workaround which seems to work, you can install two versions of the same package using an alias:

    • npm install class-validator12@npm:class-validator@0.12.2
    • npm install class-transformer3@npm:class-transformer@0.3.1

    My package.json now looks like this:

            "class-transformer": "^0.5.1",
            "class-transformer3": "npm:class-transformer@^0.3.1",
            "class-validator": "^0.13.2",
            "class-validator12": "npm:class-validator@^0.12.2",
    

    Never saw that syntax before, but this is working for me.

    @Killasushi - Could you please share your full package.json? Is there additional config you needed to do to point at the aliases? Doesn't seem to be doing the trick on my end.

  13. 3 remaining items

  14. spicemc commented on Jul 14, 2022

    @spicemc

    I am using overrides in my package.json. This is my workaround:

    ...
      "overrides": {
        "class-transformer": "^0.5.1",
        "class-validator": "^0.13.2"
      },
      "dependencies": {
        "class-transformer": "^0.5.1",
        "class-validator": "^0.13.2",
    ...
    

    Try with npm install --legacy-peer-deps to get it running.

  15. JotaRaffalli commented on Jul 28, 2022

    @JotaRaffalli

    Pls, update this 😮‍💨

  16. laujonat commented on Jul 30, 2022

    @laujonat

    No temporary workarounds?

  17. spicemc commented on Aug 29, 2022

    @spicemc

    Did you try my suggested workaround?

  18. Rasfuranku commented on Oct 31, 2022

    @Rasfuranku

    Trying to install "routing-controllers": "^0.9.0" in a new project, having the same issue.

  19. jstanislawczyk commented on Nov 14, 2022

    @jstanislawczyk

    Please update it. It's hard to use it in new project when it has such big issue

  20. spicemc commented on Nov 14, 2022

    @spicemc

    If someone is forking, please let me know!

    i forked it. Feel free to use it in your projects.

  21. NoNameProvided commented on Nov 16, 2022

    @NoNameProvided
    Member

    Hi folks! I have added branch protection bypass to @attilaorosz so he will be able to handle this.

  22. FrancisBehnen commented on Nov 16, 2022

    @FrancisBehnen

    If someone is forking, please let me know!

    i forked it. Feel free to use it in your projects.

    Awesome, I've let the team know!

  23. added
    status: has PRIssues which has a related PR closing the issue.
    and removed
    type: featureIssues related to new features.
    flag: needs discussionIssues which needs discussion before implementation.
    on Nov 23, 2022
  24. github-actions commented on Dec 27, 2022

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  25. locked as resolved and limited conversation to collaborators on Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: has PRIssues which has a related PR closing the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions