Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

fails with typescript 2.1.4 #293

Closed
andrenarchy opened this issue Dec 7, 2016 · 33 comments
Closed

fails with typescript 2.1.4 #293

andrenarchy opened this issue Dec 7, 2016 · 33 comments
Labels

Comments

@andrenarchy
Copy link

andrenarchy commented Dec 7, 2016

Updating from typescript 2.1.1 to 2.1.4 yields the following error:

TypeError: Cannot read property 'exclude' of undefined
    at applyDefaults (/home/andre/git-repos/paperhive-frontend/node_modules/awesome-typescript-loader/src/instance.ts:266:72)
    at Object.ensureInstance (/home/andre/git-repos/paperhive-frontend/node_modules/awesome-typescript-loader/src/instance.ts:145:5)
    at compiler (/home/andre/git-repos/paperhive-frontend/node_modules/awesome-typescript-loader/src/index.ts:37:20)
    at Object.loader (/home/andre/git-repos/paperhive-frontend/node_modules/awesome-typescript-loader/src/index.ts:18:18)
    at LOADER_EXECUTION (/home/andre/git-repos/paperhive-frontend/node_modules/loader-runner/lib/LoaderRunner.js:114:14)
    at runSyncOrAsync (/home/andre/git-repos/paperhive-frontend/node_modules/loader-runner/lib/LoaderRunner.js:115:4)
    at iterateNormalLoaders (/home/andre/git-repos/paperhive-frontend/node_modules/loader-runner/lib/LoaderRunner.js:224:2)
    at /home/andre/git-repos/paperhive-frontend/node_modules/loader-runner/lib/LoaderRunner.js:197:4
    at Storage.finished (/home/andre/git-repos/paperhive-frontend/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:39:16)
    at /home/andre/git-repos/paperhive-frontend/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:415:3) 'TypeError: Cannot read property \'exclude\' of undefined\n    at applyDefaults (/home/andre/git-repos/paperhive-frontend/node_modules/awesome-typescript-loader/src/instance.ts:266:72)\n    at Object.ensureInstance (/home/andre/git-repos/paperhive-frontend/node_modules/awesome-typescript-loader/src/instance.ts:145:5)\n    at compiler (/home/andre/git-repos/paperhive-frontend/node_modules/awesome-typescript-loader/src/index.ts:37:20)\n    at Object.loader (/home/andre/git-repos/paperhive-frontend/node_modules/awesome-typescript-loader/src/index.ts:18:18)\n    at LOADER_EXECUTION (/home/andre/git-repos/paperhive-frontend/node_modules/loader-runner/lib/LoaderRunner.js:114:14)\n    at runSyncOrAsync (/home/andre/git-repos/paperhive-frontend/node_modules/loader-runner/lib/LoaderRunner.js:115:4)\n    at iterateNormalLoaders (/home/andre/git-repos/paperhive-frontend/node_modules/loader-runner/lib/LoaderRunner.js:224:2)\n    at /home/andre/git-repos/paperhive-frontend/node_modules/loader-runner/lib/LoaderRunner.js:197:4\n    at Storage.finished (/home/andre/git-repos/paperhive-frontend/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:39:16)\n    at /home/andre/git-repos/paperhive-frontend/node_modules/graceful-fs/graceful-fs.js:78:16\n    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:415:3)'

This is my tsconfig.json:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "target": "es6",
    "types": ["node"]
  },
  "compileOnSave": false,
  "exclude": [
    "node_modules"
  ]
}
@snerks
Copy link

snerks commented Dec 7, 2016

Quick fix/hack:

Edit the following file:
~/node_modules/awesome-typescript-loader/dist/instance.js

Line ~142:
Replace the body of the "applyDefaults" method with the following (from master):
function applyDefaults(configFilePath, compilerConfig, loaderConfig) {

    _.defaults(compilerConfig.options, {
        sourceMap: true,
        verbose: false,
        skipDefaultLibCheck: true,
        suppressOutputPathCheck: true
    });

    if (loaderConfig.transpileOnly) {
        compilerConfig.options.isolatedModules = true;
    }

    _.defaults(compilerConfig.options, {
        sourceRoot: compilerConfig.options.sourceMap ? process.cwd() : undefined
    });

    _.defaults(loaderConfig, {
        sourceMap: true,
        verbose: false,
    });

    delete compilerConfig.options.outDir;
    delete compilerConfig.options.inlineSourceMap;
    delete compilerConfig.options.outFile;
    delete compilerConfig.options.out;
    delete compilerConfig.options.noEmit;

@mduta
Copy link

mduta commented Dec 8, 2016

Still not working with typescript 2.1.1

@s-panferov
Copy link
Owner

Which version of the loader this is related to?

@mduta
Copy link

mduta commented Dec 8, 2016

3.10.8

@digital-wonderland
Copy link

digital-wonderland commented Dec 8, 2016

This happens with 2.2.4. 3.0.0-beta.9 works fine with TypeScript 2.1.4.

@selkinvitaly
Copy link

I have the same problem with typescript 2.0.3 and awesome-typescript-loader 2.2.4

@mduta
Copy link

mduta commented Dec 8, 2016

i have the same problem with awesome-typescript-loader 3.10.8 and typescript 2.1.1 and 2.0.10

@bovan
Copy link

bovan commented Dec 8, 2016

got it working here, had to lock down typescript version

{
    "awesome-typescript-loader": "^2.2.4",
    "typescript": "2.0.10"
}

@selkinvitaly
Copy link

It fine works with locked 2.0.3 typescript version

@sanyatuning
Copy link

working with typescript 2.1.1
but not working with typescript 2.1.4

@chrissena
Copy link

Using typescript 2.1.4 and awesome-typescript-loader version 2.2.4.
I had the same error
TypeError: Cannot read property 'exclude' of undefined
Did the "Quick fix/hack" proposed by @snerks and can confirm my angular 2 app is working once more. Thanks!

@DanielMcAssey
Copy link

Same problem, pinned to Typescript 2.1.1 and it works.

joshwiens added a commit to PatrickJS/PatrickJS-starter that referenced this issue Dec 8, 2016
joshwiens added a commit to PatrickJS/PatrickJS-starter that referenced this issue Dec 8, 2016
* chore(package): pins TypeScript version to 2.1.1

- Relavent issue: s-panferov/awesome-typescript-loader#293
@arjendeblok
Copy link

Version 2.1.4 renames typingOptions from compilerConfig to typeAcquisition. See PR microsoft/TypeScript#12373. So typingOptions is no longer available. So instance.js breaks on compilerConfig.typingOptions.exclude.

@aj0strow
Copy link

Works for me on beta.

    "awesome-typescript-loader": "3.0.0-beta.9",
    "typescript": "2.1.4",

@ribizli
Copy link

ribizli commented Dec 12, 2016

If it is only renaming some options (Rename typingOptions.enableAutoDiscovery to typeAcquisition.enable), could it be get fixed in the 2.4.x also, please?

@cgatian
Copy link

cgatian commented Dec 12, 2016

Since beta has issues with remapping code coverage, this would be ideal.

sgratzl added a commit to datavisyn/datavisyn-anatomogram that referenced this issue Dec 12, 2016
sgratzl added a commit to datavisyn/datavisyn-scatterplot-react that referenced this issue Dec 12, 2016
@heocon8319
Copy link

Fixed to me : "awesome-typescript-loader": "2.2.4"
"typescript": “2.1.1”

@roshan3133
Copy link

Its fixed with "typescript": "^2.1.4" and "awesome-typescript-loader": "^3.0.0-beta.9"
and working fine

@frenic
Copy link

frenic commented Jan 24, 2017

What's the status? Object spread/rest is not working in 2.1.1. It would be nice to be able to upgrade and get rid of Object.assign and delete operators.

@cgatian
Copy link

cgatian commented Jan 24, 2017

@faddee I'm running 3.0.0-beta.17 and have no problems.

@frenic
Copy link

frenic commented Jan 25, 2017

@cgatian Thanks, but I'm also suffering from #323 and 3.0.0-beta.13 still has issues for me. So I'm stuck.

@ribizli
Copy link

ribizli commented Jan 25, 2017

We are also stuck to the 2.2 version, since 3.0's TsConfigPathsPlugin doesn't support webpack@2.2.

@Schnueggel
Copy link

still a problem 😢

MartinSGill added a commit to MartinSGill/discovery-writer that referenced this issue Feb 3, 2017
Fixes 
```
TypeError: Cannot read property 'exclude' of undefined
    at applyDefaults 
```

cf. s-panferov/awesome-typescript-loader#293
@s-panferov s-panferov added the 2.x label Feb 5, 2017
@pacoita
Copy link

pacoita commented Feb 7, 2017

Using version awesome-typescript-loader 3.0.3 and typescript 2.1.4 works.

I faced this issue using awesome-typescript-loader 2.2.4 with typescript 2.1.4 (working though with typescript 2.0.10).

@kcsahoo
Copy link

kcsahoo commented Mar 21, 2017

In tsconfig.json, I configured the following:
"awesomeTypescriptLoaderOptions": {
"useWebpackText": true,
"useTranspileModule": true,
"doTypeCheck": true,
"forkChecker": true
},

Then I am able use ATL 3.2.1 and Typescript 2.2.1
No errors.

@paigeflourin
Copy link

had error using awesome-typescript-loader 2.2.4 and typescript 2.0.10

fixed with @snerks quick fix.

@dksharp
Copy link

dksharp commented Jun 14, 2017

Nothing worked. tried everything in this thread :(

ERROR in ./src/main.ts
Module build failed: TypeError: Cannot read property 'exclude' of undefined
at applyDefaults (/usr/local/lib/node_modules/angular2-cli/node_modules/awesome-typescript-loader/src/instance.ts:266:72)
at Object.ensureInstance (/usr/local/lib/node_modules/angular2-cli/node_modules/awesome-typescript-loader/src/instance.ts:145:5)
at compiler (/usr/local/lib/node_modules/angular2-cli/node_modules/awesome-typescript-loader/src/index.ts:37:20)
at Object.loader (/usr/local/lib/node_modules/angular2-cli/node_modules/awesome-typescript-loader/src/index.ts:18:18)
@ multi main

ERROR in ./src/vendor.ts
Module build failed: TypeError: Cannot read property 'exclude' of undefined
at applyDefaults (/usr/local/lib/node_modules/angular2-cli/node_modules/awesome-typescript-loader/src/instance.ts:266:72)
at Object.ensureInstance (/usr/local/lib/node_modules/angular2-cli/node_modules/awesome-typescript-loader/src/instance.ts:145:5)
at compiler (/usr/local/lib/node_modules/angular2-cli/node_modules/awesome-typescript-loader/src/index.ts:37:20)
at Object.loader (/usr/local/lib/node_modules/angular2-cli/node_modules/awesome-typescript-loader/src/index.ts:18:18)
@ multi vendor
webpack: Failed to compile.`

@DenysVuika
Copy link

We gave up waiting months and switched to ts-loader, that solved all the issues we have with this project.

@dksharp
Copy link

dksharp commented Jun 14, 2017

@DenisVuyka can you guide me please.

@DenysVuika
Copy link

@dksharp You can refer to the official webpack guide for TypeScript that is now featuring ts-loader:

@s-panferov
Copy link
Owner

awesome-typescript-loader@2.x is not maintained. Please use 3.x branch or switch to ts-loader if you can't.

@brglabs
Copy link

brglabs commented Jul 11, 2017

"awesome-typescript-loader": "^3.0.3",
"typescript": "^2.4.1",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-merge": "^0.14.0"

It's working.

@ramseyjiang
Copy link

@rafaelsobreirabraga
"awesome-typescript-loader": "^3.0.3",
"typescript": "^2.4.1",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-merge": "^0.14.0"

The issue still there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests