read properties of undefined
tmkx opened this issue · 2 comments
tmkx commented
jest --coverage
output:
FAIL src/pages/pc/tests/app.node.spec.tsx
● Test suite failed to run
TypeError: .../player/dist/cjs/index.js: Cannot read properties of undefined (reading 'originalPositionFor')
at SourceMapTree.originalPositionFor (../../node_modules/.pnpm/@ampproject+remapping@2.0.1/node_modules/@ampproject/src/source-map-tree.ts:138:19)
at trace (../../node_modules/.pnpm/@ampproject+remapping@2.0.1/node_modules/@ampproject/src/source-map-tree.ts:70:25)
at EncodedSourceMapImpl.map (../../node_modules/.pnpm/@jridgewell+trace-mapping@0.2.2/node_modules/@jridgewell/src/encoded-map.ts:43:24)
at TraceMap.map (../../node_modules/.pnpm/@jridgewell+trace-mapping@0.2.2/node_modules/@jridgewell/src/trace-mapping.ts:85:23)
at SourceMapTree.traceMappings (../../node_modules/.pnpm/@ampproject+remapping@2.0.1/node_modules/@ampproject/src/source-map-tree.ts:42:26)
at remapping (../../node_modules/.pnpm/@ampproject+remapping@2.0.1/node_modules/@ampproject/src/remapping.ts:37:30)
at mergeSourceMap (../../node_modules/.pnpm/@babel+core@7.17.0/node_modules/@babel/core/lib/transformation/file/merge-map.js:19:30)
at generateCode (../../node_modules/.pnpm/@babel+core@7.17.0/node_modules/@babel/core/lib/transformation/file/generate.js:72:39)
at run (../../node_modules/.pnpm/@babel+core@7.17.0/node_modules/@babel/core/lib/transformation/index.js:55:33)
at run.next (<anonymous>)
should ensure not nil before call the source.originalPositionFor
?
remapping/src/source-map-tree.ts
Lines 137 to 142 in e43d71e
jridgewell commented
jridgewell commented
See also babel/babel#14229