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.
Add a comment  | 

1 Answer 1

Reset to default 0

I'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');

本文标签: graphqlDoes anyone know why express module type imports are not supported by graph ql uploadStack Overflow