2020-09-06T18:23:14.054 ERROR (pid:849114) [extension:coc-react-refactor] - Extract JSX to function: Error: /home/hoschi/repos/eg/boilerplate/babel.config.js: Error while loading config - Cannot find module '/home/hoschi/repos/eg/boilerplate/babel.config.js'
at webpackEmptyContext (/home/hoschi/.config/coc/extensions/node_modules/coc-react-refactor/lib/index.js:60138:10)
at loadCjsDefault (/home/hoschi/.config/coc/extensions/node_modules/coc-react-refactor/lib/index.js:60072:42)
at loadCjsOrMjsDefault (/home/hoschi/.config/coc/extensions/node_modules/coc-react-refactor/lib/index.js:60044:16)
at loadCjsOrMjsDefault.next (<anonymous>)
at readConfigJS (/home/hoschi/.config/coc/extensions/node_modules/coc-react-refactor/lib/index.js:58367:47)
at readConfigJS.next (<anonymous>)
at Function.<anonymous> (/home/hoschi/.config/coc/extensions/node_modules/coc-react-refactor/lib/index.js:58005:3)
at Generator.next (<anonymous>)
at evaluateSync (/home/hoschi/.config/coc/extensions/node_modules/coc-react-refactor/lib/index.js:57850:28)
at Function.sync (/home/hoschi/.config/coc/extensions/node_modules/coc-react-refactor/lib/index.js:57690:14) {
code: 'MODULE_NOT_FOUND'
}
I get this on the easiest refactorings. My babel.config.js
:
module.exports = {
presets: ["babel-preset-react-app"],
plugins: [
[
"react-intl",
{
extractFromFormatMessageCall: true,
idInterpolationPattern: "[sha512:contenthash:base64:6]",
},
],
],
env: {
test: {
plugins: ["mockable-imports"],
},
production: {
plugins: [
[
"babel-plugin-import",
{
libraryName: "@material-ui/core",
libraryDirectory: "esm",
camel2DashComponentName: false,
},
"core",
],
[
"babel-plugin-import",
{
libraryName: "@material-ui/icons",
libraryDirectory: "esm",
camel2DashComponentName: false,
},
"icons",
],
[
"babel-plugin-import",
{
libraryName: "ramda",
libraryDirectory: "es",
camel2DashComponentName: false,
},
"ramda",
],
],
},
},
}