Can't build due to Babel ERR_PACKAGE_PATH_NOT_EXPORTED
resolritter opened this issue Β· comments
Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
I've hit the following error upon trying to build the project
[build.andTest] [build.umd.main] [!] (plugin babel) Error: No "exports" main resolved in /home/reaysawa/js/final-form/node_modules/@babel/helper-compilation-targets/package.json
[build.andTest] [build.umd.main] src/index.js
[build.andTest] [build.umd.main] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /home/reaysawa/js/final-form/node_modules/@babel/helper-compilation-targets/package.json
[build.andTest] [build.umd.main] at applyExports (internal/modules/cjs/loader.js:491:9)
[build.andTest] [build.umd.main] at resolveExports (internal/modules/cjs/loader.js:507:23)
[build.andTest] [build.umd.main] at Function.Module._findPath (internal/modules/cjs/loader.js:635:31)
[build.andTest] [build.umd.main] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1007:27)
[build.andTest] [build.umd.main] at Function.Module._load (internal/modules/cjs/loader.js:890:27)
[build.andTest] [build.umd.main] at Module.require (internal/modules/cjs/loader.js:1080:19)
[build.andTest] [build.umd.main] at require (internal/modules/cjs/helpers.js:72:18)
[build.andTest] [build.umd.main] at Object.<anonymous> (/home/reaysawa/js/final-form/node_modules/@babel/preset-env/lib/debug.js:8:33)
[build.andTest] [build.umd.main] at Module._compile (internal/modules/cjs/loader.js:1176:30)
[build.andTest] [build.umd.main] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
This issue seems to be on Babel: babel/babel#11216. I've been able to solve it by upgrading the dependencies, as you'll note in the bottom.
What's your environment?
OS: Linux x64
Node: v14.2. I've tested with LTS (v12) and it has the same problem
Other information
I've been able to get build after upgrading every dependency using ncu.
@babel/runtime ^7.8.3 β ^7.9.6
@babel/core ^7.8.3 β ^7.9.6
@babel/plugin-transform-runtime ^7.8.3 β ^7.9.6
@babel/preset-env ^7.8.3 β ^7.9.6
@babel/preset-flow ^7.8.3 β ^7.9.0
@types/node ^13.1.8 β ^14.0.5
@typescript-eslint/eslint-plugin ^2.17.0 β ^3.0.1
babel-eslint ^10.0.3 β ^10.1.0
babel-jest ^25.1.0 β ^26.0.1
eslint ^6.8.0 β ^7.1.0
eslint-config-react-app ^5.1.0 β ^5.2.1
eslint-plugin-flowtype ^4.6.0 β ^5.1.0
eslint-plugin-import ^2.20.0 β ^2.20.2
eslint-plugin-react ^7.18.0 β ^7.20.0
eslint-plugin-react-hooks ^2.3.0 β ^4.0.2
flow-bin ^0.94.0 β ^0.125.1
husky ^4.2.0 β ^4.2.5
jest ^25.1.0 β ^26.0.1
lint-staged ^10.0.2 β ^10.2.6
prettier ^1.19.1 β ^2.0.5
rollup ^1.29.1 β ^2.10.9
rollup-plugin-babel ^4.3.3 β ^4.4.0
rollup-plugin-replace ^2.1.0 β ^2.2.0
tslint ^6.0.0 β ^6.1.2
typescript ^3.7.5 β ^3.9.3
This fixed it for me
babel/babel#11615 (comment)