ember-codemods / ember-angle-brackets-codemod

Codemod to convert curly braces syntax to angle brackets syntax
MIT License
60 stars 32 forks source link

Errors with 5.1.0: Cannot read property 'originalPositionFor' of undefined #497

Open dknutsen opened 2 years ago

dknutsen commented 2 years ago

We've been hitting errors when running 5.1.0 via npx:

> npx ember-angle-brackets-codemod <path-to-some-file>  --config config/angle-brackets-codemod.json
Downloading Chromium r818858 - 132.4 Mb [====================] 100% 0.0s
Processing 1 files...
Spawning 1 workers...
Sending 1 files to free worker...
[myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@babel/core/lib/transformation/index.js:66
    throw e;
    ^

TypeError: [myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/ember-template-recast/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/traversal/visitor.js: Cannot read property 'originalPositionFor' of undefined
    at SourceMapTree.originalPositionFor ([myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@ampproject/src/source-map-tree.ts:138:19)
    at trace ([myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@ampproject/src/source-map-tree.ts:70:25)
    at EncodedSourceMapImpl.map ([myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@jridgewell/src/encoded-map.ts:43:24)
    at TraceMap.map ([myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@jridgewell/src/trace-mapping.ts:85:23)
    at SourceMapTree.traceMappings ([myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@ampproject/src/source-map-tree.ts:42:26)
    at remapping ([myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@ampproject/src/remapping.ts:37:30)
    at mergeSourceMap ([myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@babel/core/lib/transformation/file/merge-map.js:19:30)
    at generateCode ([myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@babel/core/lib/transformation/file/generate.js:72:39)
    at run ([myhomedir]/.npm/_npx/37262/lib/node_modules/ember-angle-brackets-codemod/node_modules/@babel/core/lib/transformation/index.js:55:33)
    at run.next (<anonymous>) {
  code: 'BABEL_GENERATE_ERROR'
}
All done.
Results:
0 errors
0 unmodified
0 skipped
0 ok

other notes that may be relevant:

I haven't dug into the details too much. Anyone have any ideas?