-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
babelHelpers is not defined using Rollup [Solved] #1320
Comments
@alejandronanez can you give more info about how you did the install, or better yet share a repo? |
Hello @shilman, |
I played around with it and it works if I remove "external-helpers" from the |
Hmmm |
Good luck! Let us know how it works out! |
@alejandronanez, you can remove import babel from 'rollup-plugin-babel';
export default {
// ...
plugins: [
babel({
exclude: 'node_modules/**',
plugins: ['external-helpers']
}),
]
} |
Hey Esteban! Will try that! Thanks!!!!
…On Fri, Jun 23, 2017 at 4:29 PM Esteban Martini ***@***.***> wrote:
@alejandronanez <https://github.com/alejandronanez>, you can remove
external-helpers from your .babelrc file and enable it back only on your
rollup.config.js using the rollup-plugin-babel
<https://github.com/rollup/rollup-plugin-babel>
import babel from 'rollup-plugin-babel';export default {
// ...
plugins: [
babel({
exclude: 'node_modules/**',
plugins: ['external-helpers']
}),
]
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1320 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAcYUgchrgycLTXdu_Pxv9TBr7R4SxMZks5sHC47gaJpZM4N-odN>
.
|
Just tried this, worked like charm! Thanks! |
…babelrc Prevents babelHelpers ReferenceError when running the test suite Advice found here: storybookjs/storybook#1320 (comment)
…babelrc Prevents babelHelpers ReferenceError when running the test suite Advice found here: storybookjs/storybook#1320 (comment)
abortcontroller-polyfill is using rollup + babel to transpile modern JS into ES5 checked into dist/, so that other projects can import these directly regardless whether these projects are using babel themselves or not. This crash was happening when Babel was used in a project that in turn was using abortcontroller-polyfill, and when the abortcontroller-polyfill dependency was overridden using "npm link". In that case, the external-helpers declaration in the abortcontroller-polyfill would be picked up by babel running in the parent project causing the "missing babelHelpers" JS crash. "External Helpers" are generic Babel helper functions that you can choose to not emit in the beginning of every file if you prefer to provide them via other means, more here: https://babeljs.io/docs/plugins/external-helpers/ This github issue was has info on a similar issue: storybookjs/storybook#1320 (comment)
abortcontroller-polyfill is using rollup + babel to transpile modern JS into ES5 checked into dist/, so that other projects can import these directly regardless whether these projects are using babel themselves or not. This crash was happening when Babel was used in a project that in turn was using abortcontroller-polyfill, and when the abortcontroller-polyfill dependency was overridden using "npm link". Because "npm link" creates a symlink to the folder of the abortcontroller-polyfill git checkout, the entire folder is exposed and not just files that "npm install" would have installed. And in this case, the external-helpers declaration in the abortcontroller-polyfill .babelrc would be picked up by babel running in the parent project causing the "missing babelHelpers" JS crash. The "files" key in package.json was originally added to workaround the equivalent problem when "npm install" rather than "npm link" was used. "External Helpers" are generic Babel helper functions that you can choose to not emit in the beginning of every file if you prefer to provide them via other means, more here: https://babeljs.io/docs/plugins/external-helpers/ This github issue was has info on a similar issue: storybookjs/storybook#1320 (comment)
Isn't the working configuration missing... import babel from 'rollup-plugin-babel';
export default {
// ...
plugins: [
babel({
exclude: 'node_modules/**',
plugins: ['external-helpers'],
externalHelpers: true, // ...this field ???
}),
]
} |
@Tomekmularczyk from the readme
|
For future googlers -Setting format to ES module in rollup.config.js was the fix for me: Rollup docs:
|
Hello there, I created a React component library using Rollup/styled components and when I try to run story book I got this error:
I'm using master branch https://github.com/react-medellin/components/tree/master for this and regular global installation for story book.
Any ideas why is this happening?
Thanks!!!
The text was updated successfully, but these errors were encountered: