You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When migrating an Ember engine, I came across this error: TypeError: Cannot read property 'value' of undefined at ClassProperty (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/lib/utils/templates.js:22:42) at NodePath._call (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/path/context.js:55:20) at NodePath.call (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/path/context.js:42:17) at NodePath.visit (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/path/context.js:92:31) at TraversalContext.visitQueue (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/context.js:112:16) at TraversalContext.visitMultiple (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/context.js:79:17) at TraversalContext.visit (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/context.js:138:19) at Function.traverse.node (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/index.js:82:17) at NodePath.visit (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/path/context.js:99:18) at TraversalContext.visitQueue (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/context.js:112:16)
I took a look inside utils/templates.js where it was breaking and found that the issue is that one of my components had the layoutName property and it was failing the execution because of this.
It would be great to maybe surface this error in the console and making it clear to the developer that there is a component that has a reference to layoutName and they should change this before running another execution. Or maybe even handle this automatically as part of the codemod execution if it's possible.
The text was updated successfully, but these errors were encountered:
Can you provide a code snippet for the component that had an issue? At the very least we should make the error better, but I suspect that we can also just "do the right thing".
Also, can you double check and confirm which version you were using?
It was a while ago so I'm not exactly sure what the component looked like, but i'm guessing it was something like this. export default Component.extend({ layoutName='some_layout_name' });
Also not really sure the version of the codemod I was using at that time 😅
When migrating an Ember engine, I came across this error:
TypeError: Cannot read property 'value' of undefined at ClassProperty (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/lib/utils/templates.js:22:42) at NodePath._call (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/path/context.js:55:20) at NodePath.call (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/path/context.js:42:17) at NodePath.visit (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/path/context.js:92:31) at TraversalContext.visitQueue (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/context.js:112:16) at TraversalContext.visitMultiple (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/context.js:79:17) at TraversalContext.visit (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/context.js:138:19) at Function.traverse.node (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/index.js:82:17) at NodePath.visit (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/path/context.js:99:18) at TraversalContext.visitQueue (/home/bcvo/.npm/_npx/28538/lib/node_modules/ember-component-template-colocation-migrator/node_modules/@babel/traverse/lib/context.js:112:16)
I took a look inside utils/templates.js where it was breaking and found that the issue is that one of my components had the layoutName property and it was failing the execution because of this.
It would be great to maybe surface this error in the console and making it clear to the developer that there is a component that has a reference to layoutName and they should change this before running another execution. Or maybe even handle this automatically as part of the codemod execution if it's possible.
The text was updated successfully, but these errors were encountered: