Closed TolgaYld closed 2 years ago
You need to specify the full file name with the file extension:
const graphqlUploadExpress = require("graphql-upload/graphqlUploadExpress.js");
I'm not sure why you want to require the Upload
class, as that is more of an implementation detail. If you want to get the TypeScript type for what the Upload
scalar resolves, you can do it this way for JSDoc based types:
/** @type {import("graphql-upload/processRequest.js").FileUpload} */
Or this way in TypeScript (assuming you have the right TypeScript project config):
import type { FileUpload } from "graphql-upload/processRequest.js";
Hope that helps!
this is still an issue.. even with const graphqlUploadExpress = require("graphql-upload/graphqlUploadExpress.js");
it is not working
I'm having problems using graphql-upload. Does anyone have the solution?
const { graphqlUploadExpress } = require("graphql-upload");
Worked yesterday and today it doesnt;
No "exports" main defined in ....
const { graphqlUploadExpress } = require("graphql-upload");
cannot find this, there is conflict with "express-graphql": "^0.12.0", "graphql": "^15.8.0", version. How can I solve this
It seems still not worked. Any Ideas? ( "graphql-upload": "^13.0.0",)
Error message : Package subpath './graphqlUploadExpress.js' is not defined by "exports" in
Error: Package subpath './graphqlUploadExpress' is not defined by "exports".
This bug still exists! 😿😿
@Maxcrazy1 I had to downgrade all the packages related to graphql-upload. For some unknown reason, it just started to work after that.
Here's a portion of my code for your reference:
app.module.ts
import { graphqlUploadExpress } from 'graphql-upload';
...
export class AppModule implements NestModule { configure(consumer: MiddlewareConsumer) { consumer .apply(graphqlUploadExpress()) .forRoutes("graphql") } }
And it worked.
For package.json, here are the related dependencies:
In dependencies:
"graphql-upload": "^13.0.0",
in devDependencies:
"@types/graphql-upload": "^8.0.11",
Take a look and see if you could find anything useful.
Hi,
firstly sorry i think it will be a duplicate but i cant fix the error.
this was my old "import"
const { graphqlUploadExpress, Upload } = require('graphql-upload');
now i write:
and i still get this error:
"Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './Upload' is not defined by "exports" in /Users/user/Desktop/App/dummys/node/project/node_modules/graphql-upload/package.json"
How can i fix this?
thanks in advance :)