Closed herndlm closed 2 years ago
Could you provide a simple reproducer? For instance an application from scratch?
Also make sure jsonref
is updated.
I've made the package pure ESM. Please read https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c.
funny thing, I had to upgrade react-admin from 3 to 4 and @api-platform/admin from 2 to 3 still and after doing that the problem here was also gone. thank you for your effort and help anyways though!
I'm not able to update @api-platform/admin
and @api-platform/api-doc-parser/
updating everything doesn't help. I keep getting error about missing jsonref
.
jsonref is installed:
$ yarn build
react-scripts --openssl-legacy-provider build
./node_modules/@api-platform/api-doc-parser/lib/openapi3/handleJson.js
Cannot find module: 'jsonref'. Make sure this package is installed.
You can install this package by running: yarn add jsonref.
$ ls -d node_module/jsonref
node_modules/jsonref
$ yarn list
...
├─ @api-platform/api-doc-parser@0.16.4
│ ├─ graphql@^16.0.0
│ ├─ inflection@^1.13.0
│ ├─ jsonld@^8.1.0
│ ├─ jsonref@^8.0.0
│ ├─ lodash.get@^4.4.0
│ └─ tslib@^2.0.0
...
How to solve this error?
I'm not sure if this was the real problem but after installing: @api-platform/api-doc-parser
and @api-platform/admin
, in yarn list I got two version of jsonref:
$ yarn list ... ├─ @api-platform/api-doc-parser@0.16.4 │ ├─ graphql@^16.0.0 │ ├─ inflection@^1.13.0 │ ├─ jsonld@^8.1.0 │ ├─ jsonref@^8.0.0 │ ├─ lodash.get@^4.4.0 │ └─ tslib@^2.0.0 ├─ jsonref@8.0.8 ...
Installing fixed version of json ref solved the issue:
yarn add jsonref@8.0.0
Note that the library doesn't work when installed. I removed and installed it again and it still throw an error about missing jsonref.
Version(s) affected: 0.15.7
Description
Trying to upgrade from 0.15.2 to 0.15.7 gives me the following compilation error in our API platform admin app:
I verified that
node_modules/jsonref
exists. I saw that jsonref was recently added and some importing adaptions were done as well. I don't know much about different JS module types and their imports, but could this be one of the ESM/CJS incompatibilities or something like that?How to reproduce
sorry, leaving this out for now since I'm not sure yet if this is a bug or not.
Possible Solution
Additional Context