graphql-mesh icon indicating copy to clipboard operation
graphql-mesh copied to clipboard

Custom Logger not found with mesh start

Open sam-lewis opened this issue 5 months ago • 0 comments

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • [x] 1. The issue provides a reproduction available on CodeSandbox

  • [ ] 2. A failing test has been provided

  • [ ] 3. A local solution has been provided

  • [ ] 4. A pull request is pending review


Describe the bug

A custom logger definition works fine with mesh dev but fails with yarn mesh then mesh start

To Reproduce Steps to reproduce the behavior:

  • Open https://codesandbox.io/p/sandbox/spring-sun-ltgyh5
  • Run mesh dev tab
    • Observe that mesh starts and uses the custom logger
  • Run yarn mesh build && yarn mesh start
    • Observe that mesh fails to starts with error:
💥 🕸️  Mesh Error: Cannot find module './logger'
Require stack:
- /workspace/.mesh/index.ts
- /workspace/node_modules/@graphql-mesh/utils/cjs/defaultImportFn.js

Expected behavior

  • mesh starts when a logger is configured in meshrc.yml and mesh start is run.

Environment: https://codesandbox.io/p/sandbox/spring-sun-ltgyh5

Additional context

It looks like the logger import is missing a ../ in the generated index.ts. I tried with a custom fetch which has the correct relative import applied.

sam-lewis avatar Jan 26 '24 17:01 sam-lewis