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

Cannot find module 'lodash/get' #1076

Closed
mbwestphal opened this issue Nov 27, 2023 · 8 comments
Closed

Cannot find module 'lodash/get' #1076

mbwestphal opened this issue Nov 27, 2023 · 8 comments
Labels
needs_reproducer Needs a reproducer to prove the issue

Comments

@mbwestphal
Copy link

mbwestphal commented Nov 27, 2023

What are the steps to reproduce this issue?

  1. Build using PNPM

What happens?

Build fails

What were you expecting to happen?

Find module lodash/get and build

Any logs, error output, etc?

Error: Cannot find module 'lodash/get'
Require stack:
- /project/node_modules/.pnpm/@orval+core@6.20.0/node_modules/@orval/core/dist/index.js
- /project/node_modules/.pnpm/orval@6.20.0/node_modules/orval/dist/index.js

Any other comments?

orvals package.json is not listing lodash or lodash.get as a dependency.

What versions are you using?

Operating System: Debian
Package Version: 6.20.0
Browser Version: Not applicable

@melloware
Copy link
Collaborator

Can you provide a reproducer?

@melloware melloware added the needs_reproducer Needs a reproducer to prove the issue label Nov 27, 2023
@melloware
Copy link
Collaborator

can you try with 6.21.0. I can't reproduce?

@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2023
@Maxim-Mazurok
Copy link
Contributor

I think they were trying to build the orval itself using pnpm, but orval is using yarn, so pnpm isn't supported 👍

@kvet
Copy link

kvet commented Dec 11, 2023

I can confirm that the issue exists when just installing the orval@6.22.1 package using pnpm. The following hacky fix helped:

//.pnpmfile.cjs

module.exports = {
    hooks: {
      readPackage: (pkg) => {
         if (pkg.name === '@orval/core' || pkg.name === 'orval') {
            pkg.dependencies['lodash'] = '*';
         }
      }
   }
}

@melloware
Copy link
Collaborator

A PR is welcome if you know the fix?

@zereight
Copy link

zereight commented Feb 1, 2024

remove pnp

스크린샷 2024-02-01 오전 10 49 28

@mkska
Copy link

mkska commented May 6, 2024

Similar override as in #1076 (comment), but through package.json file.

{
  ...
  "pnpm": {
    "packageExtensions": {
      "orval": {
        "dependencies": {
          "lodash": "*"
        }
      },
      "@orval/core": {
        "dependencies": {
          "lodash": "*"
        }
      }
    }
  }
   ...
}

@gunzip
Copy link

gunzip commented Jun 5, 2024

I've the same issue using yarn 4.1.1 pnp and found no workaround yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_reproducer Needs a reproducer to prove the issue
Projects
None yet
Development

No branches or pull requests

7 participants