question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@babel/plugin-proposal-object-rest-spread not being detected at beta.46

See original GitHub issue

Babel/Babylon Configuration (.babelrc, package.json, cli command)

.babelrc

{
  "presets": [
    ["@babel/env", {
      "targets": { "node": "6.11.5" }
    }]
  ],
  "plugins": ["@babel/plugin-proposal-object-rest-spread"]
}

CLI Command

babel 'functions/src' --out-dir 'functions/bundle' --copy-files --ignore 'functions/src/node_modules'

Expected Behavior

Files are correctly built, as it did with beta.44

Current Behavior

With beta.46, following error arises:

Error: SyntaxError: functions/src/common/getLocations.js: Support for the experimental syntax 'objectRestSpread' isn't currently enabled (77:19):

  75 |         if (key === 'viewport'){
  76 |           const { northeast, southwest } = geometry.viewport;
> 77 |           return {...prev, bounds : {
     |                   ^
  78 |             ne : {
  79 |               lat : northeast.lat,
  80 |               lng : northeast.lng

Add @babel/plugin-proposal-object-rest-spread (https://git.io/vb4Ss) to the 'plugins' section of your Babel config to enable transformation.
    at /Users/karlas/project/node_modules/@babel/cli/lib/babel/dir.js:185:22
    at /Users/karlas/project/node_modules/@babel/cli/lib/babel/dir.js:148:23
    at /Users/karlas/project/node_modules/@babel/cli/lib/babel/dir.js:120:23
    at /Users/karlas/project/node_modules/@babel/cli/lib/babel/dir.js:82:23
    at /Users/karlas/project/node_modules/@babel/cli/lib/babel/util.js:126:16
    at runAsync (/Users/karlas/project/node_modules/@babel/core/lib/transformation/index.js:37:12)
    at /Users/karlas/project/node_modules/@babel/core/lib/transform-file.js:56:36
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

Possible Solution

Can’t help…

Context

Just transpiling about 20 files to be used on Firebase Functions

Your Environment

software version(s)
Babel 7.0.0-beta.46
node 8.11.1
npm 5.6.0
yarn 1.6.0
Operating System macOS High Sierra

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

16reactions
riflercommented, Jun 1, 2018

.babelrc.js in prj root worked until beta.44, but doesn’t in 45 and above

10reactions
karlascommented, May 8, 2018

Mmm i can´t get it work. What i made:

  1. Rename functions/src/.babelrcto functions/src/babel.config.js
  2. Add the module.exports to this file, resulting:
module.exports = {
  "presets": [
    ["@babel/env", {
      "targets": { "node": "6.11.5" }
    }]
  ],
  "plugins": ["@babel/plugin-proposal-object-rest-spread"]
}

Am I doing something wrong?

Read more comments on GitHub >

github_iconTop Results From Across the Web

@babel/plugin-proposal-object-rest-spread vulnerabilities | Snyk
version published direct vulnerabilities 7.20.2 4 Nov, 2022 0. C. 0. H. 0. M. 0. L 7.19.4 10 Oct, 2022 0. C. 0. H. 0....
Read more >
Trace: The node type SpreadProperty has been renamed to ...
I believe the problem comes from using babel-preset-react-native, which depends on /babel-plugin-transform-object-rest-spread (an older version ...
Read more >
@babel/plugin-proposal-object-rest-spread - Package Manager
Intro. Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain...
Read more >
Dependency-Check Report
Dependency CVE Count Confidence Evidence Count @ampproject/remapping:2.1.2 0 6 @babel/cli:7.19.3 1 Low 8 @babel/code‑frame:7.18.6 0 8
Read more >
3 a1892 watch - CSDN
DO NOT EDIT THIS FILE DIRECTLY. ... "@babel/helper-get-function-arity" "7.0.0-beta.44" ... "@babel/plugin-proposal-object-rest-spread@7.0.0-beta.46":.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found