Closed machty closed 6 months ago
I traced the issue down to jscodeshift, which uses babel/register to hook into require()
and transpile, on demand, any required file. For some reason, when the jscodeshift worker requires the transform file located at
'/Users/machty/.volta/tools/image/packages/ember-native-class-codemod/lib/node_modules/ember-native-class-codemod/transforms/ember-object/index.js'
it thinks it needs to wrap it in a define()
. I don't know why.
The easiest way I was able to move on from this issue was to open my local copy of jscodeshift's Worker.js and add an ignore regex for /ember-native-class-codemod/
.
Wow that sucked to debug.
The reason I was running into errors is because I still had a babel.config.js that was getting picked up by the babel/register
inside JSCodeshift. When I got rid of it, I stopped running into define is not defined
.
I'm trying to test this codemod out on a single component via this command:
But it gives me
define is not defined
with the stack trace below. I added someconsole.log
for a clue and it seems like it's barfing on trying to load/Users/machty/.npm/_npx/4e4aff0f1510c9e0/node_modules/@babel/plugin-syntax-dynamic-import/lib/index.js
after wrapping it in somedefine()
ceremony.I'd appreciate any guidance.
Ember 3.16