Closed Gamesh closed 2 years ago
Could you check your version of @api-platform/api-doc-parser
please?
@alanpoulain yarn list | grep @api-platform
├─ @api-platform/admin@3.1.1
│ ├─ @api-platform/api-doc-parser@^0.14.3
├─ @api-platform/api-doc-parser@0.14.3
strange but it seems by installing a https://www.npmjs.com/package/node-polyfill-webpack-plugin plugin the issue gets resolve, but not sure why i need this, everywhere else require("path")
seems to work fine
That's weird, json-refs
has been added to api-doc-parser
recently. I don't know why its path
dependency doesn't have a polyfill by default and why it doesn't work in your specific case.
do you want me to add anything extra? webpack config? packages.json? what could help to debug
It could be great if you can reproduce the issue in an empty project.
Good morning @alanpoulain i've created a repo with reproducible case https://github.com/Gamesh/api-platform-453
just run yarn build
I'm having the same problem with a slightly more detailed error message :
It looks like it's a webpack version/config problem but what I'm doing is just adding @api-platform/admin
to a create-react-app
project so having the admin fail on such a "standard" installation is quite annoying.
strange but it seems by installing a npmjs.com/package/node-polyfill-webpack-plugin plugin the issue gets resolve, but not sure why i need this, everywhere else
require("path")
seems to work fine
@jvasseur you can workaround it using node-polyfill-webpack-plugin
@Gamesh yes but that needs moving out of create-react-app since CRA doesn't allow overriding the webpack config to add plugins.
Should be solved by https://github.com/api-platform/api-doc-parser/pull/114.
This is effectively solved in the last version, thanks for taking the time to do it.
Awesome 👏 thank you a lot
API Platform version(s) affected: 3.1.1 yarn version: 1.22.18
Description
Module build failed: Module not found: "./node_modules/json-refs/index.js" contains a reference to the file "path". This file can not be found, please check it for typos or update it if the file got moved.
How to reproduce
This started happening after upgrade from 2.8 to 3.1.1
Any ideas?