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

Broken with latest @babel/runtime v7.3.0 #75

Closed
3cp opened this issue Jan 22, 2019 · 3 comments
Closed

Broken with latest @babel/runtime v7.3.0 #75

3cp opened this issue Jan 22, 2019 · 3 comments
Assignees
Labels

Comments

@3cp
Copy link

3cp commented Jan 22, 2019

With latest @babel/runtime v7.3.0,

TypeError: Cannot convert undefined or null to object
at Function.getOwnPropertyDescriptors ()
at _objectSpread (/Users/huocp/bw/bcx-broker-au-frontend/node_modules/@babel/runtime/helpers/objectSpread.js:19:46)
at plugin (/Users/huocp/bw/bcx-broker-au-frontend/node_modules/gulp-cache/lib/index.js:491:19)
at buildJs (/Users/huocp/bw/bcx-broker-au-frontend/gulpfile.js:102:17)
at build (/Users/huocp/bw/bcx-broker-au-frontend/gulpfile.js:128:5)

Caused by this:

gulp-cache/src/index.js

Lines 75 to 78 in 37039dc

const options = {
...plugin.defaultOptions,
...task.cacheable,
...inputOptions

The task.cacheable is undefined, causing @babel/runtime to fail.

This seems caused by the compiled code lib/index.js is based on old babel version (presets, plugins?).

Two possible fixes:

  1. (tested) fix the dep of @babel/runtime in package.json to "@babel/runtime": "~7.2.0", pinning it to 7.2.x.
  2. (not tested yet) update all deps, and publish recompiled file.
@3cp
Copy link
Author

3cp commented Jan 22, 2019

There is another possible fix. Remove @babel/runtime, don't use transform-runtime (provided by babel-preset-trigen).

That will result in slightly bigger code, but immune to future babel changes.

@dangreen dangreen self-assigned this Jan 22, 2019
@dangreen dangreen added the bug label Jan 22, 2019
3cp added a commit to dumberjs/examples that referenced this issue Jan 22, 2019
dangreen added a commit that referenced this issue Jan 23, 2019
@dangreen
Copy link
Collaborator

@huochunpeng Please try https://github.com/jgable/gulp-cache/releases/tag/v1.1.1

@3cp
Copy link
Author

3cp commented Jan 23, 2019

It works!

3cp added a commit to dumberjs/examples that referenced this issue Jan 23, 2019
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