Skip to content

Typescript 2.1.4 + webpack + ts-loader: Unhandled rejection TypeError: Cannot read property 'getOptionsDiagnostics' of undefined #12976

Description

@romiem

TypeScript Version: 2.1.4

Expected behavior:
Webpack compiles my project (it compiles fine when using Typescript 2.1.1 or 2.0.10)
There has also been a separate bug filed at ts-loader here. If you follow that thread to the end, you will see that various versions of ts-loader have been tested against Typescript and it seems to point to an issue with version 2.1.4.

Actual behavior:
Webpack throws the following error:

Unhandled rejection TypeError: Cannot read property 'getOptionsDiagnostics' of undefined at Object.getCompilerOptionsDiagnostics (/Users/romiem/my-project/node_modules/typescript/lib/typescript.js:79004:27) at provideCompilerOptionDiagnosticErrorsToWebpack (/Users/romiem/my-project/node_modules/ts-loader/dist/after-compile.js:33:92) at Compiler.<anonymous> (/Users/romiem/my-project/node_modules/ts-loader/dist/after-compile.js:14:9) at Compiler.next (/Users/romiem/my-project/node_modules/webpack/node_modules/tapable/lib/Tapable.js:69:14) at Compiler.<anonymous> (/Users/romiem/my-project/node_modules/webpack/lib/CachePlugin.js:40:4) at Compiler.applyPluginsAsync (/Users/romiem/my-project/node_modules/webpack/node_modules/tapable/lib/Tapable.js:71:13) at Compiler.<anonymous> (/Users/romiem/my-project/node_modules/webpack/lib/Compiler.js:400:9) at Compilation.<anonymous> (/Users/romiem/my-project/node_modules/webpack/lib/Compilation.js:577:13) at Compilation.applyPluginsAsync (/Users/romiem/my-project/node_modules/webpack/node_modules/tapable/lib/Tapable.js:60:69) at Compilation.<anonymous> (/Users/romiem/my-project/node_modules/webpack/lib/Compilation.js:572:10) at Compilation.applyPluginsAsync (/Users/romiem/my-project/node_modules/webpack/node_modules/tapable/lib/Tapable.js:60:69) at Compilation.<anonymous> (/Users/romiem/my-project/node_modules/webpack/lib/Compilation.js:567:9) at Compilation.next (/Users/romiem/my-project/node_modules/webpack/node_modules/tapable/lib/Tapable.js:67:11) at ExtractTextPlugin.<anonymous> (/Users/romiem/my-project/node_modules/extract-text-webpack-plugin/index.js:309:4) at Compilation.applyPluginsAsync (/Users/romiem/my-project/node_modules/webpack/node_modules/tapable/lib/Tapable.js:71:13) at Compilation.<anonymous> (/Users/romiem/my-project/node_modules/webpack/lib/Compilation.js:563:8) at Compilation.next (/Users/romiem/my-project/node_modules/webpack/node_modules/tapable/lib/Tapable.js:67:11) at ExtractTextPlugin.<anonymous> (/Users/romiem/my-project/node_modules/extract-text-webpack-plugin/index.js:285:5) at /Users/romiem/my-project/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:52:16 at Object.async.forEachOf.async.eachOf (/Users/romiem/my-project/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:236:30) at Object.async.forEach.async.each (/Users/romiem/my-project/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:209:22) at ExtractTextPlugin.<anonymous> (/Users/romiem/my-project/node_modules/extract-text-webpack-plugin/index.js:237:10) at Compilation.applyPluginsAsync (/Users/romiem/my-project/node_modules/webpack/node_modules/tapable/lib/Tapable.js:71:13) at Compilation.seal (/Users/romiem/my-project/node_modules/webpack/lib/Compilation.js:525:7) at Compiler.<anonymous> (/Users/romiem/my-project/node_modules/webpack/lib/Compiler.js:397:15) at /Users/romiem/my-project/node_modules/webpack/node_modules/tapable/lib/Tapable.js:103:11 at /Users/romiem/my-project/node_modules/html-webpack-plugin/index.js:60:9 at tryCatcher (/Users/romiem/my-project/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/romiem/my-project/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/promise.js:510:31) at Promise._settlePromise (/Users/romiem/my-project/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/promise.js:567:18)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions