jstejada / react-typist

Typing animations with React
https://jstejada.github.io/react-typist/
Other
1.4k stars 124 forks source link

Webpack error when using Gatsby #90

Open willmcl opened 4 years ago

willmcl commented 4 years ago

I am using this with Gatsby and when running gatsby develop I get the following error:

 ERROR #98123  WEBPACK

Generating development JavaScript bundle failed

Unexpected token (13:19)

File: node_modules/react-typist/src/Typist.jsx:13:19

Below are the dependencies from my package.json file. Any help would be great.

"dependencies": {
    "@contentful/rich-text-react-renderer": "^14.1.1",
    "babel-plugin-styled-components": "^1.11.1",
    "classnames": "^2.2.6",
    "gatsby": "^2.24.30",
    "gatsby-image": "^2.4.14",
    "gatsby-plugin-layout": "^1.3.10",
    "gatsby-plugin-manifest": "^2.4.22",
    "gatsby-plugin-offline": "^3.2.22",
    "gatsby-plugin-react-helmet": "^3.3.10",
    "gatsby-plugin-sharp": "^2.6.25",
    "gatsby-plugin-sitemap": "^2.4.11",
    "gatsby-plugin-styled-components": "^3.3.10",
    "gatsby-source-contentful": "^2.3.35",
    "gatsby-source-filesystem": "^2.3.24",
    "gatsby-transformer-remark": "^2.8.28",
    "gatsby-transformer-sharp": "^2.5.12",
    "moment": "^2.27.0",
    "prop-types": "^15.7.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-helmet": "^6.1.0",
    "react-transition-group": "^4.4.1",
    "react-typist": "^2.0.5",
    "showdown": "^1.9.1",
    "styled-components": "^5.1.1"
  },
cxspxr commented 4 years ago

nothing like that for me using it with gatsby and develop works fine, same with build try to create empty gatsby project with default starter and then include typist

AyrennC commented 3 years ago

I encountered the same issue, turn out I was importing from the source directly. Changing import Typist from 'react-typist/src/Typist' to import Typist from 'react-typist' should fix the error.