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

Doesn't support importing plain d.ts files #225

Open
ronzeidman opened this issue Sep 5, 2016 · 2 comments
Open

Doesn't support importing plain d.ts files #225

ronzeidman opened this issue Sep 5, 2016 · 2 comments

Comments

@ronzeidman
Copy link

ronzeidman commented Sep 5, 2016

I have a shared module for shared interfaces between my server and my client. It contains several d.ts files with interfaces I share between my server and the UI. When I use ts-loader everything works as expected, when I use this awsome typescript loader I get:

ERROR in ./src/component.ts
Module not found: Error: Cannot resolve module 'shared/data' in ...src/component
 @ ./src/component.ts 12:26-73

The shared/data should be shared/data.d.ts but it doen't find it. If I add the d.ts explicitly I get this error:

ERROR in ./src/component.ts
Module not found: Error: Cannot resolve module 'shared/data' in ...src/component.ts
 @ ./src/component.ts 12:26-73

ERROR in ./~/shared/data.d.ts
Module build failed: Error: Debug Failure. False expression: Output generation failed
    at Object.assert (node_modules\typescript\lib\typescript.js:2099:23)
    at Object.transpileModule (node_modules\typescript\lib\typescript.js:53173
:18)
    at State.fastEmit (node_modules\awesome-typescript-loader\src\host.ts:262:
39)
    at transform (node_modules\awesome-typescript-loader\src\index.ts:164:28)
    at transformationFunction (node_modules\awesome-typescript-loader\src\inde
x.ts:89:48)
    at compiler (node_modules\awesome-typescript-loader\src\index.ts:105:34)
    at Object.loader (node_modules\awesome-typescript-loader\src\index.ts:18:1
8)
 @ ./src/component.ts 12:31-83

Not critical workaround is to just change the d.ts files to ts files and transpile them to empty js files.

@sanex3339
Copy link

same

@veeramarni
Copy link

I'm facing the same issue even with .ts file which only has interfaces. It seems this issue been there for a while but there isn't any fix. After switching to tsloader it is working as expected.

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

3 participants