admin管理员组文章数量:1123419
i am using type module in package.json file so that is not working only
const { GraphQLUpload, graphqlUploadExpress, } = require('graphql-upload');
commonjs only working in module imports not working any solution that
node:internal/modules/esm/resolve:303 return new ERR_PACKAGE_PATH_NOT_EXPORTED( ^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in D:\pradeep\PC\server\node_modules\graphql-upload\package.json imported from D:\pradeep\PC\server\index.js at exportsNotFound (node:internal/modules/esm/resolve:303:10) at packageExportsResolve (node:internal/modules/esm/resolve:650:9) at packageResolve (node:internal/modules/esm/resolve:828:14) at moduleResolve (node:internal/modules/esm/resolve:918:18) at defaultResolve (node:internal/modules/esm/resolve:1148:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:541:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38) at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
anyone know solution
i am using type module in package.json file so that is not working only
const { GraphQLUpload, graphqlUploadExpress, } = require('graphql-upload');
commonjs only working in module imports not working any solution that
node:internal/modules/esm/resolve:303 return new ERR_PACKAGE_PATH_NOT_EXPORTED( ^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in D:\pradeep\PC\server\node_modules\graphql-upload\package.json imported from D:\pradeep\PC\server\index.js at exportsNotFound (node:internal/modules/esm/resolve:303:10) at packageExportsResolve (node:internal/modules/esm/resolve:650:9) at packageResolve (node:internal/modules/esm/resolve:828:14) at moduleResolve (node:internal/modules/esm/resolve:918:18) at defaultResolve (node:internal/modules/esm/resolve:1148:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:541:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38) at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
anyone know solution
Share Improve this question asked 16 hours ago PradeepPradeep 1 New contributor Pradeep is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.1 Answer
Reset to default 0I'm not sure where you got the code in your example, but in the documentation for graphql-upload (see "Exports"), it answers this question. They don't have a main index module. You can't require('graphql-upload')
const GraphQLUpload = require('graphql-upload/GraphQLUpload.mjs');
const graphqlUploadExpress = require('graphql-upload/graphqlUploadExpress.mjs');
版权声明:本文标题:graphql - Does anyone know why express module type imports are not supported by graph ql upload? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736569367a1944751.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论