Skip to content

[v2] Typescript plugin not working #5520

@jaredpalmer

Description

@jaredpalmer

Description

I tried to use the typescript plugin with v2 to no avail. I get the following error message.

ERROR in ./src/pages/index.tsx
Module parse failed: Unexpected token (3:7)
You may need an appropriate loader to handle this file type.
| import * as React from 'react';
|
| export interface IndexProps {}
|
| export interface IndexState {}
 @ ./.cache/sync-requires.js 11:51-124
 @ ./.cache/root.js
 @ ./.cache/app.js
 @ multi ./node_modules/react-hot-loader/patch.js (webpack)-hot-middleware/client.js?path=http://localhost:8000/__webpack_hmr&reload=true&overlay=false ./.cache/app
ℹ 「wdm」: Failed to compile.

Environment

  • Gatsby version (npm list gatsby): 2.0.0-alpha.40
  • gatsby-cli version (gatsby --version):
  • Node.js version: 8.9.x
  • Operating System: macOS Sierra

File contents (if changed)

gatsby-config.js:

module.exports = {
  plugins: [`gatsby-plugin-typescript`, `gatsby-plugin-react-helmet`],
};

package.json: N/A
gatsby-node.js: N/A
gatsby-browser.js: N/A
gatsby-ssr.js: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssue with a clear description that the community can help with.type: maintenanceAn issue or pull request describing a change that isn't a bug, feature or documentation change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions