i have issue
ReferenceError: Cannot access 'FOO' before initialization
i use modules with redux. when i use babel all works right
require('./node-jsx-babel').install();.
when i use esbuild-register as
const { register } = require('../node_modules/esbuild-register/dist/node');
register({
hookIgnoreNodeModules: false,
hookMatcher(fileName) {
return fileName.includes('jsx') || fileName.includes('js') || fileName.includes('ts') || fileName.includes('tsx') || fileName.includes('index')
},
});
i have this issue
ReferenceError: Cannot access 'FOO' before initialization.
when i use string 'FOO' it work.
my code
const FOO= 'mini/FOO';
export default function (
state = {
expanded: false,
},
action
) {
switch (action.type) {
case FOO:
return {
...state,
expanded: true,
};
default:
return state;
}
}
i have issue ReferenceError: Cannot access 'FOO' before initialization i use modules with redux. when i use babel all works right require('./node-jsx-babel').install();.
when i use esbuild-register as const { register } = require('../node_modules/esbuild-register/dist/node'); register({ hookIgnoreNodeModules: false, hookMatcher(fileName) { return fileName.includes('jsx') || fileName.includes('js') || fileName.includes('ts') || fileName.includes('tsx') || fileName.includes('index') }, }); i have this issue ReferenceError: Cannot access 'FOO' before initialization. when i use string 'FOO' it work.
my code
const FOO= 'mini/FOO';
export default function ( state = { expanded: false, }, action ) { switch (action.type) { case FOO: return { ...state, expanded: true, }; default: return state; } }