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

Minor version of plugin-proposal-numeric-separator suddenly breaking our app #12310

Closed
fraywing opened this issue Nov 4, 2020 · 7 comments · Fixed by #12311
Closed

Minor version of plugin-proposal-numeric-separator suddenly breaking our app #12310

fraywing opened this issue Nov 4, 2020 · 7 comments · Fixed by #12311
Labels
i: bug i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@fraywing
Copy link
Contributor

fraywing commented Nov 4, 2020

Bug Report

Current behavior
Suddenly when building our app, an upstream change in plugin-proposal-numeric-separator seems to break puppeteer.

ERROR in ./src/puppeteer/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: /Users/austin/Dev/RupieNetwork/src/puppeteer/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js: Cannot read property 'includes' of undefined
    at PluginPass.remover (/Users/austin/Dev/RupieNetwork/node_modules/@babel/plugin-proposal-numeric-separator/lib/index.js:21:26)
    at newFn (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/visitors.js:175:21)
    at NodePath._call (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/path/context.js:55:20)
    at NodePath.call (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/path/context.js:42:17)
    at NodePath.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/path/context.js:92:31)
    at TraversalContext.visitQueue (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:112:16)
    at TraversalContext.visitMultiple (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:79:17)
    at TraversalContext.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:138:19)
    at Function.traverse.node (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/index.js:82:17)
    at NodePath.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/path/context.js:99:18)
    at TraversalContext.visitQueue (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:112:16)
    at TraversalContext.visitSingle (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:84:19)
    at TraversalContext.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:140:19)
    at Function.traverse.node (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/index.js:82:17)
    at NodePath.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/path/context.js:99:18)
    at TraversalContext.visitQueue (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:112:16)
    at TraversalContext.visitMultiple (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:79:17)
    at TraversalContext.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:138:19)
    at Function.traverse.node (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/index.js:82:17)
    at NodePath.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/path/context.js:99:18)
    at TraversalContext.visitQueue (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:112:16)
    at TraversalContext.visitMultiple (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:79:17)
    at TraversalContext.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:138:19)
    at Function.traverse.node (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/index.js:82:17)
    at NodePath.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/path/context.js:99:18)
    at TraversalContext.visitQueue (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:112:16)
    at TraversalContext.visitMultiple (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:79:17)
    at TraversalContext.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/context.js:138:19)
    at Function.traverse.node (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/index.js:82:17)
    at NodePath.visit (/Users/austin/Dev/RupieNetwork/node_modules/@babel/traverse/lib/path/context.js:99:18)
 @ ./src/puppeteer/node_modules/puppeteer/lib/cjs/puppeteer/node/Puppeteer.js 61:26-56
 @ ./src/puppeteer/node_modules/puppeteer/lib/cjs/puppeteer/initialize-node.js
 @ ./src/puppeteer/node_modules/puppeteer/lib/cjs/puppeteer/node.js
 @ ./src/puppeteer/node_modules/puppeteer/cjs-entry.js
 @ ./src/puppeteer/controllers/saveToPdf.js
 @ ./src/puppeteer/routes/index.js
 @ ./src/puppeteer/index.js
 @ multi ./src/puppeteer/index.js

Expected behavior
Was working a day ago, now when we delete yarn.lock it appears that a minor version of package dependencies within preset-env are causing problems.

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

  • Filename: babel.config.js
  const presets = [['@babel/env']];
  const plugins = [
    'transform-class-properties', '@babel/plugin-proposal-nullish-coalescing-operator'
  ];

Environment

System:
    OS: macOS 10.15.6
  Binaries:
    Node: 15.0.1 - /usr/local/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 7.0.3 - /usr/local/bin/npm
  npmPackages:
  "@babel/cli": "^7.12.0",
    "@babel/core": "^7.12.3",
    "@babel/node": "^7.10.5",
    "@babel/plugin-proposal-export-default-from": "^7.10.4",
    "@babel/plugin-syntax-export-default-from": "^7.10.4",
    "@babel/preset-env": "^7.12.0",
    "@babel/preset-react": "^7.10.4",
    "@babel/runtime": "^7.12.0",
    "babel-eslint": "10.1.0",
    "babel-jest": "^25.5.1",
    "babel-loader": "8.1.0",
    "babel-plugin-dynamic-import-node": "^2.3.3",
    "babel-plugin-import": "1.13.1",
    "babel-plugin-module-resolver": "^4.0.0",
    "babel-plugin-transform-async-to-generator": "^7.0.0-beta.3",
    "babel-plugin-transform-class-properties": "^7.0.0-beta.3",
    "babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3",
    "babel-preset-react-app": "^9.1.2",

- Babel version(s): [e.g. v^7.12.3]
- Node/npm version: [e.g. Node 15]
- OS: macOS 10.15.6
- Monorepo: yes, yarn
- How you are using Babel: cli
@babel-bot
Copy link
Collaborator

Hey @fraywing! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@nicolo-ribaudo
Copy link
Member

I don't understand why it happens, but the fix is easy:

if (extra && extra.raw.includes("_")) {
should be replaced with

  if (extra?.raw?.includes("_")) {

Do you want to open a PR?


Probably not related, but you shouldn't use 7.0.0-beta.* versions of Babel packages alongside with stable 7.x packages.

@fraywing
Copy link
Contributor Author

fraywing commented Nov 4, 2020

@nicolo-ribaudo done #12311

@existentialism
Copy link
Member

Might be pushing our luck, but any chance for a repo that reproduces the problem? 😄

@fraywing
Copy link
Contributor Author

fraywing commented Nov 4, 2020

haha, I wish I could provide. We're just using puppeteer in a webpack environment ¯_(ツ)_/¯

@fraywing
Copy link
Contributor Author

Can we get this released?

@nicolo-ribaudo
Copy link
Member

I can release v7.12.7 tomorrow evening. Sorry we completely forgot to release a patch for this regression 😅

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 19, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants