Skip to content

Typescript Build Issue #1390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
only-cliches opened this issue Apr 2, 2017 · 1 comment
Closed

Typescript Build Issue #1390

only-cliches opened this issue Apr 2, 2017 · 1 comment

Comments

@only-cliches
Copy link

only-cliches commented Apr 2, 2017

Running into a build issue with the newest version of Fabric.

Running Windows 10 x64
NPM v3.10.10
NodeJS v7.3.0
Typescript v2.2.1
Office UI Fabric React v2.10.5
React v15.4.2

tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "ES5",
        "allowJs": false,
        "jsx": "react",
        "noImplicitReturns": true,
        "preserveConstEnums": true,
        "experimentalDecorators": true,
        "removeComments": true,
        "sourceMap": true,
        "noEmit": false,
        "skipLibCheck": true
    },
    "exclude": [
        "./node_modules"
    ]
}

This started happening all of the sudden when upgrading from Office ui 2.7.1.

I get a long list of build errors, all of them exactly like this but with different components:

ERROR in ./~/office-ui-fabric-react/lib/components/Spinner/Spinner.Props.ts
Module build failed: Error: Typescript emitted no output for C:\Users\Scott\dentist-app\node_modules\office-ui-fabric-react\lib\components\Spinner\Spinner.Pr
ops.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
    at Object.loader (C:\Users\Scott\dentist-app\node_modules\ts-loader\dist\index.js:32:15)
 @ ./~/office-ui-fabric-react/lib/components/Spinner/index.js 7:9-35
 @ ./~/office-ui-fabric-react/lib/Spinner.js
 @ ./src/js/index.tsx
 @ ./src/client.tsx
 @ multi ./src/client.tsx

I've looked into the issue on Google and tried a variety of changes to the TSconfig file with no success.

@only-cliches
Copy link
Author

Jumped the gun a little here, found the solution if anyone else drops in with the same problem.

In Webpack.config.js make sure your resolve section looks like this:

    resolve: {
        extensions: ['.js', '.ts', '.tsx']
    },

It's important that js comes before the typescript files.

Reference

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
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

1 participant