graphql-mesh
graphql-mesh copied to clipboard
Custom Logger not found with mesh start
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
andmesh 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.