moleculerjs / moleculer-apollo-server

:rocket: Apollo GraphQL server for Moleculer
MIT License
100 stars 56 forks source link

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './public/extractFiles' is not defined by "exports" in /app/node_modules/extract-files/package.json #121

Open irzhywau opened 1 year ago

irzhywau commented 1 year ago

got this error when using node 18, with node 16 it's a deprecated warning only.

Apparently it's about the dependencies, there is already a ticket that solve this issue in the buggy dependency https://github.com/jaydenseric/extract-files/issues/17

$ npm list extract-files

api-layer@0.2.0 /app/api-leyer
└─┬ moleculer-apollo-server@0.3.7
  └─┬ graphql-tools@7.0.5
    ├─┬ @graphql-tools/links@7.1.0
    │ └─┬ apollo-upload-client@13.x.x
    │   └── extract-files@9.0.0 deduped
    └─┬ @graphql-tools/url-loader@6.10.1
      └── extract-files@9.0.0 overridden
shawnmcknight commented 1 year ago

Same issue as noted in https://github.com/moleculerjs/moleculer-apollo-server/issues/103#issuecomment-1187588252. The only solution today is to use the override functionality in your package manager:

npm overrides pnpm overrides yarn resolutions

shawnmcknight commented 1 year ago

Currently, I am using the following pnpm overrides:

    "overrides": {
      "@graphql-tools/links@7>apollo-upload-client": "15.0.0",
      "@graphql-tools/url-loader@6>extract-files": "10.0.0",
      "graphql-request@5>extract-files": "10.0.0"
    },
malaDev commented 1 year ago

Im actually doing the same but I think it would be better to upgrade the deps on this repo

nmeri17 commented 10 months ago

Currently, I am using the following pnpm overrides:

    "overrides": {
      "@graphql-tools/links@7>apollo-upload-client": "15.0.0",
      "@graphql-tools/url-loader@6>extract-files": "10.0.0",
      "graphql-request@5>extract-files": "10.0.0"
    },

@shawnmcknight is there a typo here? It's rejecting the > characters as invalid tags

icebob commented 1 week ago

For npm:

"overrides": {
    "@graphql-tools/links@7": {
      "apollo-upload-client": "15.0.0"
    },
    "@graphql-tools/url-loader@6": {
      "extract-files": "10.0.0"
    },
    "graphql-request@5": {
      "extract-files": "10.0.0"
    }
  }