Package breaks when depending on @babel/core 7.12.10 · Issue #2620 · atom/github · GitHub
Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Package breaks when depending on @babel/core 7.12.10 #2620

Open

Description

@DeeDeeG

Prerequisites

(Checklist is mostly not applicable to this issue.)

Description

CI fails and package stops working IRL when upgrading the @babel/core dependency to 7.12.10 (the latest published version).

Also filed as: babel/babel#12715

Steps to Reproduce

  1. Locally in this repository, run npm install @babel/core@latest
  2. Try to run the tests

OR

  1. Install github via a git URL or tarball URL to the Atom repo or to one's .atom/packages folder
    i. Example workflows: apm install atom/github OR npm install atom/github OR npm install https://github.com/atom/github/tarball/v0.36.7
  2. Try to use the package

Expected behavior:

Tests pass, package can be loaded in Atom

Actual behavior:

Error when trying to load the package:

Error: Cannot find module './assert-messages-plugin.js'
Full require stack (click to expand):
Error: Cannot find module './assert-messages-plugin.js'
Require stack:
- /home/runner/work/github/github/node_modules/@babel/core/lib/config/files/plugins.js
- /home/runner/work/github/github/node_modules/@babel/core/lib/config/files/index.js
- /home/runner/work/github/github/node_modules/@babel/core/lib/index.js
- /home/runner/work/github/github/node_modules/@atom/babel7-transpiler/lib/index.js
- /home/runner/work/_temp/atom/usr/share/atom-nightly/resources/app.asar/src/package-transpilation-registry.js
- /home/runner/work/_temp/atom/usr/share/atom-nightly/resources/app.asar/src/compile-cache.js
- /home/runner/work/_temp/atom/usr/share/atom-nightly/resources/app.asar/static/index.html
    at Module._resolveFilename (internal/modules/cjs/loader.js:627:15)
    at Module._resolveFilename (/home/runner/work/_temp/atom/usr/share/atom-nightly/resources/electron.asar/common/reset-search-paths.js:41:16)
    at Function.Module._resolveFilename (/home/runner/work/_temp/atom/usr/share/atom-nightly/resources/app.asar/src/module-cache.js:336:28)
    at require.resolve (/home/runner/work/_temp/atom/usr/share/atom-nightly/resources/app.asar/src/native-compile-cache.js:70:23)
    at resolveStandardizedName (/home/runner/work/github/github/node_modules/@babel/core/lib/config/files/plugins.js:100:7)
    at resolvePlugin (/home/runner/work/github/github/node_modules/@babel/core/lib/config/files/plugins.js:44:10)
    at loadPlugin (/home/runner/work/github/github/node_modules/@babel/core/lib/config/files/plugins.js:52:20)
    at createDescriptor (/home/runner/work/github/github/node_modules/@babel/core/lib/config/config-descriptors.js:154:9)
    at /home/runner/work/github/github/node_modules/@babel/core/lib/config/config-descriptors.js:109:50
    at Array.map (<anonymous>)
    at createDescriptors (/home/runner/work/github/github/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
    at createPluginDescriptors (/home/runner/work/github/github/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
    at plugins (/home/runner/work/github/github/node_modules/@babel/core/lib/config/config-descriptors.js:40:19)
    at mergeChainOpts (/home/runner/work/github/github/node_modules/@babel/core/lib/config/config-chain.js:415:26)
    at /home/runner/work/github/github/node_modules/@babel/core/lib/config/config-chain.js:374:7
    at Generator.next (<anonymous>)
    at loadFileChain (/home/runner/work/github/github/node_modules/@babel/core/lib/config/config-chain.js:228:24)
    at loadFileChain.next (<anonymous>)
    at buildRootChain (/home/runner/work/github/github/node_modules/@babel/core/lib/config/config-chain.js:135:29)
    at buildRootChain.next (<anonymous>)
    at loadPrivatePartialConfig (/home/runner/work/github/github/node_modules/@babel/core/lib/config/partial.js:101:62)
    at loadPrivatePartialConfig.next (<anonymous>)
    at loadFullConfig (/home/runner/work/github/github/node_modules/@babel/core/lib/config/full.js:57:46)
    at loadFullConfig.next (<anonymous>)
    at Object.transform (/home/runner/work/github/github/node_modules/@babel/core/lib/transform.js:25:45)
    at transform.next (<anonymous>)
    at evaluateSync (/home/runner/work/github/github/node_modules/gensync/index.js:251:28)
    at Object.sync (/home/runner/work/github/github/node_modules/gensync/index.js:89:14)
    at /home/runner/work/github/github/node_modules/@atom/babel7-transpiler/lib/index.js:54:28
    at withBabelEnv (/home/runner/work/github/github/node_modules/@atom/babel7-transpiler/lib/index.js:18:15)

Reproduces how often:

100%

Versions

@babel/core 7.12.10

Additional Information

Also filed as an issue at the babel repo: babel/babel#12715

Activity

  1. DeeDeeG commented on Jan 29, 2021

    @DeeDeeG
    ContributorAuthor

    Another take on the title for this PR could be:
    "Installing the latest github package from master branch (apm install atom/github) is broken"


    The cause:

    This package's package-lock.json isn't sent (or is ignored) when grabbing this package as a git remote URL or a tarball URL. So the latest @babel/core 7.x is resolved, which happens to be this one 7.12.10 that breaks the package.

    I have tested this and it works all the way through @babel/core 7.12.9.

    CI runs: https://github.com/DeeDeeG/github/actions?query=branch%3Apin-babel

  2. DeeDeeG commented on Jan 29, 2021

    @DeeDeeG
    ContributorAuthor

    Actually I might have remembered this wrong and only the tarball URL thing is broken: npm install https://github.com/atom/github/tarball/v0.36.7

    I think apm install atom/github still works. Running it to confirm. Edit: apm install atom/github is either inconsistent or always broken. I just tried it again and it gave me this error.

    I also had some issues upgrading github at the Atom repo, but I see the recent PR used @babel/core 7.12.10 and passed tests... maybe this is because of cding into the package and installing all exact dependencies from package-lock.json.

    I know there are some scenarios that are broken with latest @babel/core. Like locally installing and running tests in this repo.

  3. changed the title [-]Package breaks when used with @babel/core 7.12.0[/-] [+]Package breaks when used with @babel/core 7.12.10[/+] on Jan 29, 2021
  4. changed the title [-]Package breaks when used with @babel/core 7.12.10[/-] [+]Package breaks when depending on @babel/core 7.12.10[/+] on Jan 29, 2021
  5. DeeDeeG commented on Jan 29, 2021

    @DeeDeeG
    ContributorAuthor

    A quick and dirty solution to this would be to pin @babel/core to less than 7.12.10 in package.json.


    Example:

    npm install --package-lock-only --save-exact @babel/core@'7.0.0 - 7.12.9'

    Some semver options: 7.0.0 - 7.12.9 or 7.x < 7.12.10 or 7.12.9

  6. nicolo-ribaudo commented on Jan 29, 2021

    @nicolo-ribaudo

    I'm looking into this Babel bug.

  7. DeeDeeG commented on Jan 29, 2021

    @DeeDeeG
    ContributorAuthor

    @nicolo-ribaudo thank you!

  8. nicolo-ribaudo commented on Jan 29, 2021

    @nicolo-ribaudo

    Reposting from the issue in the babel/babel repository:

    This is an Atom bug. Starting from Babel 7.10.0 we started using the require.resolve function in Node.js >= 8.9, because it supports the paths option (Node.js docs)

    However, Atom completely overrides the require.resolve function with a custom one, removing support for the paths option.
    Babel (as well as most of the packages on npm) assumes that the Node.js API hasn't been modified in ways incompatible with the built-in Node.js functions, so there isn't much that we can do to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions