Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use with nest js #93

Open
Hellomik2002 opened this issue Apr 16, 2023 · 3 comments
Open

Can't use with nest js #93

Hellomik2002 opened this issue Apr 16, 2023 · 3 comments

Comments

@Hellomik2002
Copy link

.../clinic-node/dist/src/graphql_upload/processRequest.js:4
const fs_capacitor_1 = require("fs-capacitor");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module .../clinic-node/node_modules/.pnpm/[email protected]/node_modules/fs-capacitor/dist/index.js from .../clinic-node/dist/src/graphql_upload/processRequest.js not supported.
Instead change the require of index.js in .../clinic-node/dist/src/graphql_upload/processRequest.js to a dynamic import() which is available in all CommonJS modules.
at Object. (.../clinic-node/dist/src/graphql_upload/processRequest.js:4:24)
at Object. (.../clinic-node/dist/src/graphql_upload/graphqlUploadExpress.js:14:29)
at Object. (.../clinic-node/dist/src/main.js:5:35)

@mozsinrb
Copy link

mozsinrb commented Jul 5, 2023

I have the same problem

@onzag
Copy link

onzag commented Dec 10, 2023

Same here on my own code that doesn't even use nest js

This is just proof of the immaturity of the NodeJS ecosystem newer packages will not work with good old CommonJS

I recommend you either just copy and paste the source code and don't install via npm, or rewrite your entire codebase including nest js itself to work with esm modules.

This doesn't have to be with the code itself, it's just Node; this is why npm install isn't good.

I will just copy paste since I refuse to refactor my entire codebase.

@Allakazan
Copy link

There is a fix to it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants