How to debug "TypeScript emitted no output for..." properly?
See original GitHub issueSorry, but I don’t know were to ask, so I hope I get some help here as I don’t find any other helpful resources.
We currently try to switch from “awesome-typescript-loader” to “ts-loader”. Simply switching the webpack config leads to errors like the following:
[...]
Module build failed (from ./node_modules/ts-loader/index.js):
Error: TypeScript emitted no output for [...]
without any more helpful information.
tsc
for example run without a problem.
So my question is: How can I find out / debug deeper, what in detail is happening and maybe to get some more helpful error messages?
I expect that the error originates from typescript not being able to do some import
statements properly but I did not find a way to debug, what is going wrong and why.
if it helps tsconfig.json
:
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["es6", "dom", "esnext"],
"module": "commonjs",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": false,
"sourceMap": true,
"strict": true,
"target": "es5"
},
"include": ["./frontend/**/*"]
}
thanks in advance!
EDIT:
So I tried to track it down and now I have the following file, that does not compile with ts-loader
with the above error message and i am really lost^^
import React from 'react';
type InventoryStatsProps = {
t: any;
i18n: any;
tReady: boolean;
};
export const InventoryStatsTile: React.FC<InventoryStatsProps> = () => {
return <div>lkajskdjaksd</div>;
};
export default InventoryStatsTile;
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
@berickson1’s excellent debugging guide* 😉
Hi @andrewbranch and @johnnyreilly , just read the excellent guide, but I didn’t get to know how to expose the detailed error of TypeScript under the hood, can you please give some advice? The requirement is simple, just want to see the exact error of tsc compiling process.