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

graphql-mesh doesn't work nicely with pnpm #4456

Closed
4 tasks
nezdemkovski opened this issue Sep 8, 2022 · 5 comments
Closed
4 tasks

graphql-mesh doesn't work nicely with pnpm #4456

nezdemkovski opened this issue Sep 8, 2022 · 5 comments

Comments

@nezdemkovski
Copy link

nezdemkovski commented Sep 8, 2022

Issue workflow progress

Progress of the issue based on the Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

Graphql Mesh doesn't work nicely with pnpm. Mesh peer dependencies don't get hoisted or symlinked right probably.

 ERROR in ./libs/mesh/src/.mesh/index.ts 10:52-94
       Module not found: Error: Can't resolve '@graphql-mesh/cache-localforage' in '/Users/yuri/Sites/igluu/igluu/igluu-app/libs/mesh/src/.mesh'
       
       ERROR in ./libs/mesh/src/.mesh/index.ts 11:16-45
       Module not found: Error: Can't resolve '@whatwg-node/fetch' in '/Users/yuri/Sites/igluu/igluu/igluu-app/libs/mesh/src/.mesh'
       
       ERROR in ./libs/mesh/src/.mesh/index.ts 18:51-92
       Module not found: Error: Can't resolve '@graphql-mesh/merger-stitching' in '/Users/yuri/Sites/igluu/igluu/igluu-app/libs/mesh/src/.mesh'
       
       ERROR in ./libs/mesh/src/.mesh/index.ts 19:15-44
       Module not found: Error: Can't resolve '@graphql-mesh/http' in '/Users/yuri/Sites/igluu/igluu/igluu-app/libs/mesh/src/.mesh'
       
       ERROR in ./libs/mesh/src/.mesh/index.ts 20:18-50
       Module not found: Error: Can't resolve '@graphql-mesh/runtime' in '/Users/yuri/Sites/igluu/igluu/igluu-app/libs/mesh/src/.mesh'
       
       ERROR in ./libs/mesh/src/.mesh/index.ts 21:16-46
       Module not found: Error: Can't resolve '@graphql-mesh/store' in '/Users/yuri/Sites/igluu/igluu/igluu-app/libs/mesh/src/.mesh'
       
       ERROR in ./libs/mesh/src/.mesh/index.ts 22:24-62
       Module not found: Error: Can't resolve '@graphql-mesh/cross-helpers' in '/Users/yuri/Sites/igluu/igluu/igluu-app/libs/mesh/src/.mesh'
       
       ERROR in ./libs/mesh/src/.mesh/sources/GraphQL/types.ts:2:36
       TS2307: Cannot find module '@graphql-mesh/types' or its corresponding type declarations.
           1 |
         > 2 | import { InContextSdkMethod } from '@graphql-mesh/types';
             |                                    ^^^^^^^^^^^^^^^^^^^^^
           3 | import { MeshContext } from '@graphql-mesh/runtime';
           4 |
           5 | export namespace GraphQlTypes {
       
       ERROR in ./libs/mesh/src/.mesh/sources/GraphQL/types.ts:3:29
       TS2307: Cannot find module '@graphql-mesh/runtime' or its corresponding type declarations.
           1 |
           2 | import { InContextSdkMethod } from '@graphql-mesh/types';
         > 3 | import { MeshContext } from '@graphql-mesh/runtime';
             |                             ^^^^^^^^^^^^^^^^^^^^^^^
           4 |
           5 | export namespace GraphQlTypes {
           6 |   export type Maybe<T> = T | null;
       
       ERROR in ./libs/mesh/src/.mesh/sources/OrderApi/types.ts:2:36
       TS2307: Cannot find module '@graphql-mesh/types' or its corresponding type declarations.
           1 |
         > 2 | import { InContextSdkMethod } from '@graphql-mesh/types';
             |                                    ^^^^^^^^^^^^^^^^^^^^^
           3 | import { MeshContext } from '@graphql-mesh/runtime';
           4 |
           5 | export namespace OrderApiTypes {
       
       ERROR in ./libs/mesh/src/.mesh/sources/OrderApi/types.ts:3:29
       TS2307: Cannot find module '@graphql-mesh/runtime' or its corresponding type declarations.
           1 |
           2 | import { InContextSdkMethod } from '@graphql-mesh/types';
         > 3 | import { MeshContext } from '@graphql-mesh/runtime';
             |                             ^^^^^^^^^^^^^^^^^^^^^^^
           4 |
           5 | export namespace OrderApiTypes {
           6 |   export type Maybe<T> = T | null;
       
       ERROR in ./libs/mesh/src/.mesh/sources/RealkoExport/types.ts:2:36
       TS2307: Cannot find module '@graphql-mesh/types' or its corresponding type declarations.
           1 |
         > 2 | import { InContextSdkMethod } from '@graphql-mesh/types';
             |                                    ^^^^^^^^^^^^^^^^^^^^^
           3 | import { MeshContext } from '@graphql-mesh/runtime';
           4 |
           5 | export namespace RealkoExportTypes {
       
       ERROR in ./libs/mesh/src/.mesh/sources/RealkoExport/types.ts:3:29
       TS2307: Cannot find module '@graphql-mesh/runtime' or its corresponding type declarations.
           1 |
           2 | import { InContextSdkMethod } from '@graphql-mesh/types';
         > 3 | import { MeshContext } from '@graphql-mesh/runtime';
             |                             ^^^^^^^^^^^^^^^^^^^^^^^
           4 |
           5 | export namespace RealkoExportTypes {
           6 |   export type Maybe<T> = T | null;

To Reproduce
Steps to reproduce the behavior:

Replacing yarn/npm in any example should do the trick.

Expected behavior

Mesh generated files should have all peer deps installed/linked right

Environment:

  • OS: macOS, Linux
  •   "@graphql-mesh/graphql": "^0.31.5",
      "@graphql-mesh/json-schema": "^0.35.6",
      "@graphql-mesh/merger-bare": "^0.15.19",
      "@graphql-mesh/openapi": "^0.33.7",
      "@graphql-mesh/transform-naming-convention": "^0.10.75",
      "@graphql-mesh/transform-prefix": "^0.11.74",
      "@graphql-mesh/transform-resolvers-composition": "^0.12.84",
      "@graphql-mesh/utils": "^0.41.5",
    
  • NodeJS: 16.
  • I use pnpm with auto-install-peers=true flag enabled

Additional context

@nezdemkovski nezdemkovski changed the title graphql-mesh doesn't work work nicely with pnpm graphql-mesh doesn't work nicely with pnpm Sep 9, 2022
@ardatan
Copy link
Owner

ardatan commented Sep 9, 2022

I don't know much about pnpm. I'd recommend to use Yarn v1 as we do in the project.

@mnlbox
Copy link

mnlbox commented Jun 5, 2023

@nezdemkovski Did you manage to use pnpm with Mesh finally?

@nezdemkovski
Copy link
Author

@nezdemkovski Did you manage to use pnpm with Mesh finally?

nope, we got rid of Mesh at the end of the day 😅

@ardatan ardatan closed this as completed Jun 5, 2023
@ardatan
Copy link
Owner

ardatan commented Jun 5, 2023

Closing the issue then. Feel free to create a new issue with a reproduction on CodeSandbox if someone else has the same issue.

@dpnova
Copy link
Sponsor

dpnova commented Nov 27, 2023

Using mesh with pnpm fine here FWIW.

This was referenced Apr 30, 2024
This was referenced May 7, 2024
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

4 participants