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.

Upgrading from `@babel/parser@7.3.3` to `7.3.4` causes segfault/parser errors on Node 6

See original GitHub issue

Bug Report

Current Behavior Upgrading the Jest repo from @babel/parser@7.3.3 to @babel/parser@7.3.4 causes Node 6 to either seemingly stop transpiling (leading to syntax errors in every test) or just die with a segfault. I’ve spent most of today tweaking different versions in our lockfile to try to narrow down which version it regressed on, and I’m quite certain the issue is in 7.3.4 - I had 3 failures with it and 3 passes with 7.3.3 reverting between them with no other changes to the code.

You can see my adventure here: https://github.com/facebook/jest/pull/8014

Most of the time it just seemingly stops parsing correctly, but sometimes it leads to segfault. I’ve never seen it fail on node 8, 10 or 11.

Input Code

You can see in that PR that the only change is using just @babel/parse@7.3.4, and it fails CI. Upgrading @babel/core as well makes no difference. CircleCI running Node 6 is the interesting CI - the other failures are either me cancelling builds or the CI provider cancelling redundant builds.

I’m sorry I’m not able to reduce it more - it happens locally for me as well on Node 6 (but not all the time) after a few minutes running the tests. Hopefully this is enough information for you to investigate. It’s at least isolated to a patch release of a single package.

Expected behavior/code I expect it to not fail 😃

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

https://github.com/facebook/jest/blob/ae8280f7b009c141b81576171ee784d336d09800/babel.config.js

// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

module.exports = {
  babelrcRoots: ['examples/*'],
  overrides: [
    {
      presets: ['@babel/preset-flow'],
      test: '**/*.js',
    },
    {
      plugins: [
        'babel-plugin-typescript-strip-namespaces',
        require.resolve(
          './scripts/babel-plugin-jest-replace-ts-export-assignment.js'
        ),
      ],
      presets: ['@babel/preset-typescript'],
      test: /\.tsx?$/,
    },
  ],
  plugins: [
    ['@babel/plugin-transform-modules-commonjs', {allowTopLevelThis: true}],
    '@babel/plugin-transform-strict-mode',
  ],
  presets: [
    [
      '@babel/preset-env',
      {
        shippedProposals: true,
        targets: {node: 6},
      },
    ],
  ],
};

Environment

  • Babel version(s): core@7.3.3, parser@7.3.4
  • Node/npm version: Node 6, yarn 1.13.0
  • OS: macOS, but CI is Linux
  • Monorepo: Yes, Yarn Workspaces
  • How you are using Babel: babel-jest

Additional context/Screenshots Stopped transpiling: https://circleci.com/gh/facebook/jest/54093 Segfault: https://circleci.com/gh/facebook/jest/54414

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
danezcommented, Mar 2, 2019

I will have a look. There weren’t that many changes between this two versions.

My guess is that the segfault is coming from jest which gets overwhelmed when thousands of tests fail. I experienced this (or at least similar behavior) also in babel when I make stupid changes that make every test explode.

Never the less will look into the Syntax errors.

0reactions
nicolo-ribaudocommented, Sep 2, 2019

Note that reducing memory consumption is still a goal, and we will gladly accept PRs

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade to Babel 7
This just means Babel itself won't run on older versions of Node. It can still output code that runs on old Node versions....
Read more >
Error when you upgrade the cluster node - SQL Server
Cause. This issue occurs because of changes in Windows Server 2012 Failover Clustering. Resolution. This section covers the following actions:.
Read more >
"Error downloading content, error code 3" -- Upgrading 7.3.1 ...
"Error downloading content, error code 3" -- Upgrading 7.3.1 to 7.3.2 XDR Endpoint (windows). Go to solution.
Read more >
Upgrade to 7.5.6 destroyed the cluster - Help - SingleStore
Hi, I just upgraded my cluster from 7.3.5 to 7.5.6 and it destroyed my cluster. ... PS: all nodes throw the same error...
Read more >
Upgrading node version throws node-sass error when trying ...
Like you noticed, this happens because your environment has changed since running npm install. Just run npm rebuild node-sass to build the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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