svengau / cra-bundle-analyzer

Use Webpack Bundle Analyzer on a create-react-app application without ejecting
47 stars 3 forks source link

[ERR_PACKAGE_PATH_NOT_EXPORTED] #2

Open bartlomiejzuber opened 4 years ago

bartlomiejzuber commented 4 years ago

It throws an error, I am using latest CRA version.

Error message:

Build app and generate report...
analyzing... [==================  ][92%][0.7 seconds] - chunk asset optimizationError parsing bundle asset "Z:\Repos\project\build\static\js\main.4618758d.chunk.js": no such file
Error parsing bundle asset "Z:\Repos\project\build\static\js\runtime-main.0a7f180f.js": no such file

No bundles were parsed. Analyzer will show only original module sizes from stats file.

Webpack Bundle Analyzer saved report to Z:\Repos\project\build\report.html
Build completed in 0.773s

(node:15352) UnhandledPromiseRejectionWarning: Error: ./src/index.tsx
Module build failed (from ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './plugin-bugfixes' is not defined by "exports" in Z:\Repos\project\node_modules\@babel\compat-data\package.json
    at applyExports (internal/modules/cjs/loader.js:524:9)
    at resolveExports (internal/modules/cjs/loader.js:541:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:661:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:963:27)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (Z:\Repos\project\node_modules\babel-preset-react-app\node_modules\@babel\preset-env\lib\plugins-compat-data.js:10:46)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Z:\Repos\project\node_modules\cra-bundle-analyzer\src\index.js:66:23
    at finalCallback (Z:\Repos\project\node_modules\webpack\lib\Compiler.js:257:39)
    at Z:\Repos\project\node_modules\webpack\lib\Compiler.js:273:13
    at _next2 (eval at create (Z:\Repos\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:14:1)
    at eval (eval at create (Z:\Repos\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:40:1)
    at Immediate.<anonymous> (Z:\Repos\project\node_modules\webpack-bundle-analyzer\lib\BundleAnalyzerPlugin.js:79:13)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (Z:\Repos\project\node_modules\webpack-bundle-analyzer\lib\BundleAnalyzerPlugin.js:3:103)
    at _next (Z:\Repos\project\node_modules\webpack-bundle-analyzer\lib\BundleAnalyzerPlugin.js:5:194)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15352) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15352) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Package.json

...
"dependencies": {
    "@material-ui/core": "^4.9.9",
    "@material-ui/icons": "^4.9.1",
    "@material-ui/lab": "^4.0.0-alpha.48",
    "@react-hook/mouse-position": "^3.1.0",
    "axios": "^0.19.2",
    "chokidar-cli": "^2.1.0",
    "clsx": "^1.1.0",
    "color": "^3.1.2",
    "connected-react-router": "^6.8.0",
    "date-fns": "^2.12.0",
    "i18next": "^19.4.1",
    "image-size": "^0.8.3",
    "is-image": "^3.0.0",
    "lodash.get": "^4.4.2",
    "mime-types": "^2.1.26",
    "promise-file-reader": "^1.0.2",
    "react": "^16.13.1",
    "react-dnd": "^10.0.2",
    "react-dnd-html5-backend": "^10.0.2",
    "react-dom": "^16.13.1",
    "react-i18next": "^11.3.4",
    "react-redux": "^7.2.0",
    "react-router-dom": "^5.1.2",
    "react-scripts": "3.4.1",
    "redux": "^4.0.4",
    "redux-form": "^8.3.5",
    "redux-form-validators": "^3.3.2",
    "redux-observable": "^1.2.0",
    "typescript": "~3.8.3",
    "use-open-window": "^1.2.4",
    "uuid": "^7.0.3"
  },
...

Is there something I miss ? I've installed and ran this tool as suggested inside this repo readme file.

svengau commented 4 years ago

Hi @bartlomiejzuber, I've tried with the latest version of CRA, and it works fine. I can't reproduce your problem. If you can isolate this issue in a simple project, I will have a look.