mannynotfound / react-tweet

React.js component for rendering tweets as they are presented on Twitter.com
67 stars 43 forks source link

Build error #26

Closed zebra-ok closed 6 years ago

zebra-ok commented 6 years ago

With the recent changes in build process, I get the following error output after running npm install on a fresh clone of the master branch:

$ npm install
npm WARN deprecated babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! 
npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.

> react-tweet@1.4.0 prepublish /home/fabi/github/react-tweet
> npm run build:js

> react-tweet@1.4.0 build:js /home/fabi/github/react-tweet
> babel --plugins transform-runtime ./src/components -d ./lib

SyntaxError: src/components/Tweet/Context.js: Unexpected token (10:6)
   8 | 
   9 |     return (
> 10 |       <div className="context" style={styles.context}>
     |       ^
  11 |         <div className="tweet-context">
  12 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 72" style={styles.IconContext}>
  13 |             <path d="M70.676 36.644C70.166 35.636 69.13 35 68 35h-7V19c0-2.21-1.79-4-4-4H34c-2.21 0-4 1.79-4 4s1.79 4 4 4h18c.552 0 .998.446 1 .998V35h-7c-1.13 0-2.165.636-2.676 1.644-.51 1.01-.412 2.22.257 3.13l11 15C55.148 55.545 56.046 56 57 56s1.855-.455 2.42-1.226l11-15c.668-.912.767-2.122.256-3.13zM40 48H22c-.54 0-.97-.427-.992-.96L21 36h7c1.13 0 2.166-.636 2.677-1.644.51-1.01.412-2.22-.257-3.13l-11-15C18.854 15.455 17.956 15 17 15s-1.854.455-2.42 1.226l-11 15c-.667.912-.767 2.122-.255 3.13C3.835 35.365 4.87 36 6 36h7l.012 16.003c.002 2.208 1.792 3.997 4 3.997h22.99c2.208 0 4-1.79 4-4s-1.792-4-4-4z"/>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-tweet@1.4.0 build:js: `babel --plugins transform-runtime ./src/components -d ./lib`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-tweet@1.4.0 build:js script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/fabi/.npm/_logs/2018-01-21T22_02_16_701Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-tweet@1.4.0 prepublish: `npm run build:js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-tweet@1.4.0 prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
mannynotfound commented 6 years ago

@art1fa what versions of npm/node are you running?

zebra-ok commented 6 years ago

npm 5.5.1 node 9.2.1

Maybe the babel react-preset is missing?

mannynotfound commented 6 years ago

@art1fa seems the .babelrc was getting excluded with .gitignore. should work now after https://github.com/mannynotfound/react-tweet/commit/f53c8ff02ece38394e9dd7ed64694c9c3514abba

zebra-ok commented 6 years ago

Yep, it's working fine now. Thanks ;)