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

mesh build fails when package.json has type: module

Open xaqwilliam opened this issue 1 month ago • 1 comments

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

To Reproduce Steps to reproduce the behavior:

Expected behavior

Environment:

  • OS:
  • @graphql-mesh/...:
  • NodeJS:

Additional context

I cant find any information on whether or not this is supported, these are the errors: In addition attempting to build .mesh with tsc in order to import "getBuiltMesh" into another packages results in errors. I have spent a considerable amount of time trying to figure this out.

Unable to write file "/Users/xxxx/services/mesh-graphql/.mesh/sources/CRUD/pgCache.json.ts". This might cause an inconsistency. TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/xxxx/services/mesh-graphql/.mesh/sources/CRUD/pgCache.json.ts
    at new NodeError (node:internal/errors:405:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:136:11)
    at defaultGetFormat (node:internal/modules/esm/get_format:182:36)
    at defaultLoad (node:internal/modules/esm/load:101:20)
    at ModuleLoader.load (node:internal/modules/esm/loader:416:13)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:287:22)
    at new ModuleJob (node:internal/modules/esm/module_job:63:26)
    at ModuleLoader.#createModuleJob (node:internal/modules/esm/loader:311:17)
    at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:264:34)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:17) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
Unable to write file "/Users/xxxxx/services/mesh-graphql/.mesh/sources/Stripe/schemaWithAnnotations.ts". This might cause an inconsistency. TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/xxxx/services/mesh-graphql/.mesh/sources/Stripe/schemaWithAnnotations.ts
    at new NodeError (node:internal/errors:405:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:136:11)
    at defaultGetFormat (node:internal/modules/esm/get_format:182:36)
    at defaultLoad (node:internal/modules/esm/load:101:20)
    at ModuleLoader.load (node:internal/modules/esm/loader:416:13)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:287:22)
    at new ModuleJob (node:internal/modules/esm/module_job:63:26)
    at ModuleLoader.#createModuleJob (node:internal/modules/esm/loader:311:17)
    at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:264:34)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:17) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

xaqwilliam avatar May 20 '24 22:05 xaqwilliam