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

TS 2.0 - shorthand ambient module declarations #231

Open
krlm opened this issue Sep 7, 2016 · 2 comments
Open

TS 2.0 - shorthand ambient module declarations #231

krlm opened this issue Sep 7, 2016 · 2 comments

Comments

@krlm
Copy link

krlm commented Sep 7, 2016

I've got a problem with using a shorhand ambient module declarations, (more about them here: https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#shorthand-ambient-module-declarations) and awesome-typescript-loader (ver. 2.2.4).
Declarations from declarations.d.ts file are not recognized by awesome-typescript-loader and I'm getting following errors:

ERROR in [default] <PATH>\client\common-controls\links Links.tsx:9:36
Cannot find module 'react-responsive'.

ERROR in [default] <PATH>\client\common-controls\memberships\MembershipRow.tsx:15:37
Cannot find module 'react-responsive'.
...and so on

My declarations.d.ts file looks like this:

declare module "react-responsive";
declare module "smoothscroll-polyfill";
declare module "object.entries";

and it just works with ts-loader or directly with tsc compiler with the same tsconfig.json.
My tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "jsx": "react",
        "types": [
            "jasmine",
            "node"
        ]
    },
    "awesomeTypescriptLoaderOptions": {
        "useBabel": true,
        "useCache": true
    },
    "include": [
        "./**/*.ts",
        "./**/*.tsx"
    ]
}

Thanks in advance for any hints.

@Tragetaschen
Copy link

#205?

@krlm
Copy link
Author

krlm commented Sep 8, 2016

@Tragetaschen yes, it's probably the same issue. I didn't notice it.

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

No branches or pull requests

2 participants