Skip to content
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

Does not use .babelrc #41

Closed
gajus opened this issue Apr 4, 2016 · 7 comments
Closed

Does not use .babelrc #41

gajus opened this issue Apr 4, 2016 · 7 comments
Labels

Comments

@gajus
Copy link

gajus commented Apr 4, 2016

My .babelrc:

{
    "presets": [
        "es2015",
        "stage-0",
        "react"
    ]
}

My project tree:

./
├── LICENSE
├── README.md
├── package.json
├── src
│   ├── index.js
│   └── stories
│       └── player.js
└── test
    ├── mocha.opts
    └── reactYoutubePlayer.js

6 directories, 11 files

(./node_modules is excluded).

When I run babel ./src/index.js program works as expected (compiles code using the presets defined in the ./babelrc).

When I run node ./node_modules/.bin/start-storybook -p 9001, I get an error:

React Storybook started on => http://localhost:9001/

webpack built eca07f0b3a93021ca496 in 1950ms
Hash: eca07f0b3a93021ca496
Version: webpack 1.12.14
Time: 1950ms
            Asset     Size  Chunks             Chunk Names
  admin.bundle.js  2.53 MB       0  [emitted]  admin
preview.bundle.js  2.69 MB       1  [emitted]  preview
chunk    {0} admin.bundle.js (admin) 900 kB [rendered]
    [0] multi admin 40 bytes {0} [built]
    (removed, not relevant)
  [312] (webpack)-hot-middleware/process-update.js 3.88 kB {1} [built]

ERROR in ./src/index.js
Module build failed: SyntaxError: /Users/gajus/Documents/dev/gajus/react-youtube-player/src/index.js: Missing class properties transform.
 */
class ReactYoutubePlayer extends React.Component {
    static stateNames = {
        '-1': 'unstarted',
        0: 'ended',
        1: 'playing',
    at File.buildCodeFrameError (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-core/lib/transformation/file/index.js:407:15)
    at NodePath.buildCodeFrameError (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-traverse/lib/path/index.js:149:26)
    at pushBody (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-plugin-transform-es2015-classes/lib/vanilla.js:254:20)
    at buildBody (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-plugin-transform-es2015-classes/lib/vanilla.js:233:10)
    at run (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-plugin-transform-es2015-classes/lib/vanilla.js:151:10)
    at PluginPass.ClassExpression (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-plugin-transform-es2015-classes/lib/index.js:63:60)
    at newFn (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-traverse/lib/visitors.js:262:19)
    at NodePath._call (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-traverse/lib/path/context.js:63:18)
    at NodePath.call (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-traverse/lib/path/context.js:47:17)
    at NodePath.visit (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-traverse/lib/path/context.js:93:12)
    at TraversalContext.visitQueue (/Users/gajus/Documents/dev/gajus/react-youtube-player/node_modules/babel-traverse/lib/context.js:152:16)
 @ ./.storybook/config.js 6:4-32

It appears that start-storybook is not using ./.babelrc.

@gajus
Copy link
Author

gajus commented Apr 4, 2016

Hm. Interestingly, if I change .babelrc to:

{
    "presets": [
        "does-not-exist"
    ]
}

I am getting:

ERROR in ./.storybook/config.js
Module build failed: Error: Couldn't find preset "does-not-exist" relative to directory "/Users/gajus/Documents/dev/gajus/react-youtube-player"

@gajus
Copy link
Author

gajus commented Apr 4, 2016

Relevant versions:

➜  react-youtube-player git:(master) ✗ node -v
v5.10.0
➜  react-youtube-player git:(master) ✗ npm -v
3.8.3

@arunoda
Copy link
Member

arunoda commented Apr 4, 2016

Could you send me your versions of:

  • webpack-hot-middleware
  • webpack-dev-middleware

This is the project right? Where's the .babelrc file?

@gajus
Copy link
Author

gajus commented Apr 4, 2016

Sorry, .babelrc is in the main directory. I did not notice that tree program excluded it from the ascii tree.

There is no local version of webpack-hot-middleware or webpack-dev-middleware.

While https://github.com/gajus/react-youtube-player is the project, I have not pushed the code using ./src setup upstream.

I have created an issue that replicates the issue, https://github.com/gajus/react-youtube-player/tree/storybook.

To replicate:

git clone git@github.com:gajus/react-youtube-player.git
git checkout storybook
npm install
npm demo

@arunoda
Copy link
Member

arunoda commented Apr 4, 2016

Got it. Will check that.

@arunoda
Copy link
Member

arunoda commented Apr 4, 2016

I think I got the issue and will work on a fix.

@arunoda arunoda added the bug label Apr 4, 2016
@arunoda arunoda closed this as completed in 43e8870 Apr 4, 2016
@arunoda arunoda reopened this Apr 4, 2016
@arunoda
Copy link
Member

arunoda commented Apr 4, 2016

Check the version 1.3.0

@arunoda arunoda closed this as completed in b9cec46 Apr 5, 2016
ndelangen pushed a commit that referenced this issue Apr 5, 2017
ndelangen pushed a commit that referenced this issue Apr 5, 2017
ndelangen pushed a commit that referenced this issue Apr 5, 2017
Prepare the channel for addons before the storybook is loaded
ndelangen pushed a commit that referenced this issue Apr 11, 2017
Write test cases for dataStore
ndelangen pushed a commit that referenced this issue Apr 15, 2017
Add note about version requirement to readme
ndelangen pushed a commit that referenced this issue Feb 23, 2024
…script

Change code for Javascript projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants