Gatsby: [Bug Report 🐞] gatsby develop fails while using gatsby-plugin-typescript

Created on 7 Jul 2019  ·  2Comments  ·  Source: gatsbyjs/gatsby

Description

All my Gatsby sites (using gatsby-plugin-typescript) that used to work are now failing when I freshly install gatsby and try to run gatsby develop. Although gatsby build builds the site perfectly fine.
Has something changed in the past few days that might cause this?

Steps to reproduce

  1. Clone this example repository: https://github.com/RepositoryTemplates/typescript-gatsby
  2. Install dependencies and start develop script: yarn && yarn start and you'll see these warnings:
WARNING  Compiled with 6 warnings                                                                                                                                                                              3:19:45 AM⠀
 warning  in ./src/layouts/default.tsx
⠀
"export 'default' (imported as 'Footer') was not found in '../components/Footer'
⠀
 warning  in ./src/layouts/default.tsx
⠀
"export 'default' (imported as 'Header') was not found in '../components/Header'
⠀
 warning  in ./src/pages/index.tsx
⠀
"export 'default' (imported as 'Helmet') was not found in '../components/Helmet'
⠀
 warning  in ./src/pages/404.tsx
⠀
"export 'default' (imported as 'Layout') was not found in '../layouts/default'
⠀
 warning  in ./src/pages/index.tsx
⠀
"export 'default' (imported as 'Layout') was not found in '../layouts/default'
⠀
 warning  in ./src/layouts/default.tsx
⠀
"export 'default' (imported as 'Main') was not found in '../components/Main'
  1. Open browser to view the site and you'll see this error:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `HotExportedComponent`.

Expected result

This should start the hot reloaded site.

Actual result

Shows the warnings & errors mentioned above.

Environment

gatsby: ^2.8.6 => 2.13.6
gatsby-plugin-emotion: ^4.0.7 => 4.1.0
gatsby-plugin-react-helmet: ^3.0.12 => 3.1.0
gatsby-plugin-typescript: ^2.0.15 => 2.0.15

Most helpful comment

For me the change needed was

// before
import Helmet from "react-helmet"

// after
import { Helmet } from "react-helmet"

All 2 comments

For me the change needed was

// before
import Helmet from "react-helmet"

// after
import { Helmet } from "react-helmet"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

3CordGuy picture 3CordGuy  ·  3Comments

dustinhorton picture dustinhorton  ·  3Comments

benstr picture benstr  ·  3Comments

dustinhorton picture dustinhorton  ·  3Comments

totsteps picture totsteps  ·  3Comments