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
{{ message }}
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.
I'm using TS@1.6.2 configured to output ES6 and sourcemaps, outside of webpack.
Then using webpack@1.12.2 with source-map-loader@0.1.5 preloader, and babel-loader@5.3.1 loader.
If original TS source contains a Decorator, the following exception is thrown
Error: No element indexed by 1
at ArraySet_at as at
at SourceMapConsumer. (c:\src\webpack\node_modules\webpack-core\node_modules\source-map\lib\source-map\source-map-consumer.js:147:69)
at Array.map (native)
at SourceMapConsumer_eachMapping as eachMapping
at Function.SourceNode_fromStringWithSourceMap as fromStringWithSourceMap
at SourceMapSource.node (c:\src\webpack\node_modules\webpack-core\lib\SourceMapSource.js:41:20)
at ReplaceSource.node (c:\src\webpack\node_modules\webpack-core\lib\ReplaceSource.js:55:29)
at CachedSource.node (c:\src\webpack\node_modules\webpack-core\lib\CachedSource.js:41:22)
at PrefixSource.node (c:\src\webpack\node_modules\webpack-core\lib\PrefixSource.js:27:26)
at c:\src\webpack\node_modules\webpack-core\lib\ConcatSource.js:38:49
If the babel-loader is disabled (simply by changing test pattern to non matching regex), no exceptions are thrown and output is as expected.
If the Decorator call is disabled (simply by removing the '@' before the call), no exceptions are thrown and output is as expected.
It appears either source-map-loader, babel-loader, or webpack-core is generating a SourceMapSource object where its sourceMap.sources property contains 1 element set to "decoratorChoking.ts", but the sourceMap.sourcesContent contains 2 elements. The 1st element is the TypeScript transpiled Javascript; i.e. the contents of decoratorChoking.js, and the 2nd the original TypeScript source; i.e. the contents of decoratorChoking.ts. This is the cause of the above exception, although not the root cause of course.
Simply removing the @ symbol in front of @ChokingDecorator within decoratorChoking.ts results in a SourceMapSource object having only one element in sourceMap.sourcesContent, it being the contents of the original TypeScript file decoratorChoking.ts. This does not cause an exception to be thrown.
Kindest regards in helping locate and resolve this bug please.
The text was updated successfully, but these errors were encountered:
I'm using TS@1.6.2 configured to output ES6 and sourcemaps, outside of webpack.
Then using webpack@1.12.2 with source-map-loader@0.1.5 preloader, and babel-loader@5.3.1 loader.
If original TS source contains a Decorator, the following exception is thrown
If the babel-loader is disabled (simply by changing test pattern to non matching regex), no exceptions are thrown and output is as expected.
If the Decorator call is disabled (simply by removing the '@' before the call), no exceptions are thrown and output is as expected.
To Reproduce:
tsconfig.json
webpack.config.js
decoratorChoking.ts
It appears either source-map-loader, babel-loader, or webpack-core is generating a
SourceMapSource
object where itssourceMap.sources
property contains 1 element set to"decoratorChoking.ts"
, but thesourceMap.sourcesContent
contains 2 elements. The 1st element is the TypeScript transpiled Javascript; i.e. the contents of decoratorChoking.js, and the 2nd the original TypeScript source; i.e. the contents of decoratorChoking.ts. This is the cause of the above exception, although not the root cause of course.Simply removing the
@
symbol in front of@ChokingDecorator
within decoratorChoking.ts results in aSourceMapSource
object having only one element insourceMap.sourcesContent
, it being the contents of the original TypeScript file decoratorChoking.ts. This does not cause an exception to be thrown.Kindest regards in helping locate and resolve this bug please.
The text was updated successfully, but these errors were encountered: