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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Release 7.17.0 breaks downstream plugins #14233

Closed
1 task
l0gicgate opened this issue Feb 3, 2022 · 15 comments 路 Fixed by #14241
Closed
1 task

[Bug]: Release 7.17.0 breaks downstream plugins #14233

l0gicgate opened this issue Feb 3, 2022 · 15 comments 路 Fixed by #14241
Labels
i: bug i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@l0gicgate
Copy link

l0gicgate commented Feb 3, 2022

馃捇

  • Would you like to work on a fix?

How are you using Babel?

babel-loader (webpack)

Input code

import { SomeComponent } from '~/some/aliased/path`;

Configuration file name

No response

Configuration

No response

Current and expected behavior

Not to break downstream plugins

Environment

  • @babel/core 7.17.0
  • Node v12.13.0
  • NPM v6.12.0

Possible solution

No response

Additional context

This is the error that started occurring after updating from @babel/core: 7.16.12 to 7.17.0

[eslint-import-resolver-babel-module] TypeError: [BABEL] C:\Redacted\src\components\ui\Nav\AccountMenu\AccountMenu.js: Cannot add property 1, object is not extensible
    at Array.push (<anonymous>)
    at C:\Redacted\node_modules\@babel\core\lib\config\full.js:314:26
    at Generator.next (<anonymous>)
    at Function.<anonymous> (C:\Redacted\node_modules\@babel\core\lib\gensync-utils\async.js:25:3)
    at Generator.next (<anonymous>)
    at evaluateSync (C:\Redacted\node_modules\gensync\index.js:251:28)
    at Function.sync (C:\Redacted\node_modules\gensync\index.js:89:14)
    at sync (C:\Redacted\node_modules\@babel\core\lib\gensync-utils\async.js:68:25)
    at sync (C:\Redacted\node_modules\gensync\index.js:182:19)
    at onFirstPause (C:\Redacted\node_modules\gensync\index.js:210:24)
    at Generator.next (<anonymous>)
    at cachedFunction (C:\Redacted\node_modules\@babel\core\lib\config\caching.js:66:46)
    at cachedFunction.next (<anonymous>)
    at loadPluginDescriptor (C:\Redacted\node_modules\@babel\core\lib\config\full.js:282:17)
    at loadPluginDescriptor.next (<anonymous>)
    at loadPluginDescriptors (C:\Redacted\node_modules\@babel\core\lib\config\full.js:170:33)

@babel-bot
Copy link
Collaborator

Hey @l0gicgate! 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

We need your config, or even better an example that shows the crash.

@JLHwung
Copy link
Contributor

JLHwung commented Feb 3, 2022

Is this issue reproduced in @babel/traverse@7.16.8? 7.16.8 comes with a bug fix of wrong behaviour which some plugins may depend on.
Can you provide a reproduction repo?

@nicolo-ribaudo
Copy link
Member

This is related to the extendedDependencies tracking. When loading a plugin, we usually:

  1. create an externalDependencies array for the plugin
  2. if the plugin inherits from another plugin:
    1. load the inherited plugin
    2. push the externalDependencies of the inherited plugin into the externalDependencies of the plugin we are loading
  3. freeze externalDependencies of the plugin we are loading

However, for some reason externalDependencies of the plugin we are loading is already frozen at step 2.2: I don't understand why it's possible, so we need to know which plugin is causing this.

@l0gicgate
Copy link
Author

@nicolo-ribaudo here's my babel config:

{
  "env": {
    "development": {
      "plugins": [
        "@babel/plugin-proposal-class-properties",
        [
          "@babel/plugin-transform-runtime",
          {
            "absoluteRuntime": false,
            "corejs": false,
            "version": "^7.7.4"
          }
        ],
        [
          "module-resolver",
          {
            "root": ["./src"],
            "alias": {
              "~": "./src"
            }
          }
        ]
      ],
      "presets": [
        "airbnb",
        "@babel/preset-env",
        "@babel/preset-react"
      ]
    },
    "production": {
      "plugins": [
        "@babel/plugin-proposal-class-properties",
        [
          "@babel/plugin-transform-runtime",
          {
            "absoluteRuntime": false,
            "corejs": false,
            "version": "^7.7.4"
          }
        ],
        [
          "module-resolver",
          {
            "root": ["./src"],
            "alias": {
              "~": "./src"
            }
          }
        ],
        ["transform-react-remove-prop-types", {
          "mode": "remove",
          "ignoreFilenames": ["node_modules"],
          "removeImport": true
        }]
      ],
      "presets": [
        "airbnb",
        "@babel/preset-env",
        "@babel/preset-react"
      ]
    },
    "staging": {
      "plugins": [
        "@babel/plugin-proposal-class-properties",
        [
          "@babel/plugin-transform-runtime",
          {
            "absoluteRuntime": false,
            "corejs": false,
            "version": "^7.7.4"
          }
        ],
        [
          "module-resolver",
          {
            "root": ["./src"],
            "alias": {
              "~": "./src"
            }
          }
        ],
        ["transform-react-remove-prop-types", {
          "mode": "remove",
          "ignoreFilenames": ["node_modules"],
          "removeImport": true
        }]
      ],
      "presets": [
        "airbnb",
        "@babel/preset-env",
        "@babel/preset-react"
      ]
    }
  }
}

@nicolo-ribaudo
Copy link
Member

Are you running with NODE_ENV (or BABEL_ENV) set to development, production or staging? (you have different configs for different envs)

@l0gicgate
Copy link
Author

NODE_ENV set to development @nicolo-ribaudo

@jaggaer-epiccini

This comment was marked as off-topic.

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Feb 3, 2022

@jaggaer-epiccini That looks unrelated, please create a new issue with instructions to reproduce the bug

@nicolo-ribaudo
Copy link
Member

It might be caused by this babel update, but it's a different error. Please open a new repository with some steps to reproduce the problem, and the full stack trace of that CRA error.

@nicolo-ribaudo
Copy link
Member

@l0gicgate I tried reproducing the error at https://github.com/nicolo-ribaudo/babel-bug-1423, but it compiles succesfully (using npm run build) 馃槄

Could you try creating a small repo I can use to see the error?

@l0gicgate
Copy link
Author

@nicolo-ribaudo I stripped everything down as best as I could with minimal dependencies to reproduce the issue. Here's the repository:
https://github.com/l0gicgate/babel-core-issue-14233

Let me know if you need anything else

@Haroenv
Copy link
Contributor

Haroenv commented Feb 4, 2022

Haroenv added a commit to algolia/vue-instantsearch that referenced this issue Feb 4, 2022
Haroenv added a commit to algolia/vue-instantsearch that referenced this issue Feb 4, 2022
* ci

* try patching

* existing versions

* lower, maybe that works

seems related to babel/babel#14233
@nicolo-ribaudo
Copy link
Member

Thanks @l0gicgate; I was able to trim your repository down even more (first removing webpack, and then some ESLint stuff), and I managed to create a reproduction that only uses Babel (#14241).

However, I will not be available much this weekend and next week, so it might take a while before I fix it. In the meantime, please pin @babel/core to the last working version (e.g. ~7.16.0).

@l0gicgate
Copy link
Author

@nicolo-ribaudo thank you for promptly addressing this. I will pin to 7.16 until #14241 gets merged! Have a good weekend!

@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 May 19, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2022
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.

6 participants