Open kukjevov opened 7 years ago
Met this problem also, 3.1.3 is fine.
I have also come across this problem and 3.1.3 works fine for me too. Our production Webpack build works fine, but the issue arises when running tests using Karma.
I have the same problem with 3.2.1
version, 3.1.3
works fine.
Still a problem with 3.2.2
. @s-panferov, why did you close this issue?
We are also having the same issue. It is particularly problematic because we do not even have a way of manually listing out the .d.ts
files in the files
TSConfig option, which seems to be the solution; we generate typings files for .graphql
and .scss
files, so these are entirely dynamic.
A number of people seem to be running into this. These appear to be dupes: https://github.com/s-panferov/awesome-typescript-loader/issues/473 https://github.com/s-panferov/awesome-typescript-loader/issues/481
This appears to be a deliberate change, but it's certainly a surprising one...
I might have found a workaround, at least one that works in my case. Evidently, when I generated tsconfig.json, I never changed the include
key from the default of "./src/**/*"
to my actual directory ("./app/**/*"
).
I found this by switching from awesome-typescript-loader to ts-loader, which then printed out the helpful message:
error TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["./src/**/*"]' and 'exclude' paths were '["./target/app/"]'.
Fixing that fixed ts-loader, then I switched back to awesome-typescript-loader and it kept working!
have the same issue.
I switched to ts-loader
, and the problem solved itself.
maybe you should check your declaration.d.ts
file whether include your tsconfig.json
search scope.
for example: directories structur
|- src
|-components
|-typings
|-declaration.d.ts
|-tsconfig.json
tsconfig.json
{
"include": [ "src" ]
...
}
then compiler can not find your declaration types.
hope can help you ~
@dancon that couldn't be the cause as merely switching loaders resolves this. This was quite a while ago though, so maybe it's fixed by now.
@jshado1 maybe you are right, but I does not change the loader and just expand the tscongif.json search scope by change the include
pattern to exclude
pattern, then it works fine ~~
With
"awesome-typescript-loader": "~3.1.3"
everything is working nicely. After upgrading to version3.2.x
i got following error:in this repository https://github.com/kukjevov/ng-universal-demo/tree/mine you can see code.
You will not be able to install it, because of some proprietary packages, but you can see code.
Problem is not during normal build, but only during tests running using karma.
here is d.ts https://github.com/kukjevov/ng-universal-demo/blob/mine/config/global.d.ts here is karma configuration https://github.com/kukjevov/ng-universal-demo/blob/mine/karma.conf.js here is import (one of many) that fails after upgrade https://github.com/kukjevov/ng-universal-demo/blob/mine/app/components/navigation/navigation.component.ts
I can update repository so you will be able to install it if needed.