SOFA icon indicating copy to clipboard operation
SOFA copied to clipboard

ESM modules are broken

Open taybin opened this issue 1 year ago • 0 comments

I found this while using graphql-yoga's sofa plugin, but even using sofa-api directly replicated this.

I tried different versions and they all had similar errors:

graphql-1            | Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/usr/src/app/node_modules/.pnpm/[email protected][email protected]/node_modules/sofa-api/esm/router' imported from /usr/src/app/node_modules/.pnpm/[email protected][email protected]/node_modules/sofa-api/esm/index.js
graphql-1            |     at finalizeResolution (node:internal/modules/esm/resolve:265:11)
graphql-1            |     at moduleResolve (node:internal/modules/esm/resolve:933:10)
graphql-1            |     at defaultResolve (node:internal/modules/esm/resolve:1157:11)
graphql-1            |     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
graphql-1            |     at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
graphql-1            |     at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38)
graphql-1            |     at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
graphql-1            |     at link (node:internal/modules/esm/module_job:86:36) {
graphql-1            |   code: 'ERR_MODULE_NOT_FOUND',
graphql-1            |   url: 'file:///usr/src/app/node_modules/.pnpm/[email protected][email protected]/node_modules/sofa-api/esm/router'
graphql-1            | }

taybin avatar Jul 17 '24 15:07 taybin