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