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

Workaround for self-referencing packages #12906

Merged
merged 1 commit into from Feb 25, 2021

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Feb 25, 2021

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

The lockfile changes in 039eb27 break the tests of bb558aa. Note that it only breaks our test, any package outside of this monorepo would work without problems.

We can revert this PR after the next release, by bumping @babel/runtime in our lockfile.

I think this is a Yarn bug (it's just a non-supported feature), I posted a description in #12893 (comment):

Are self-references (documented in the first tip here) supposed to work with the node_modules linker?

After merging this PR to main (bb558aa) the tests that here was passing started failing. I can consistently reproduce it with Node.js 13.6 (which doesn't natively implement self-references), running make bootstrap and node test/runtime-integration/src/main-cjs.cjs.

The problem is that packages/babel-runtime has require() calls like

var objectWithoutPropertiesLoose = require("@babel/runtime/helpers/objectWithoutPropertiesLoose");

and this ends up requiring node_modules/@babel/runtime (which is the version downloaded from the registry) rather than packages/babel-runtime.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 25, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f2ee491:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@babel-bot
Copy link
Collaborator

babel-bot commented Feb 25, 2021

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/42679/

@nicolo-ribaudo nicolo-ribaudo force-pushed the workaround-self-ref branch 2 times, most recently from b48c988 to 8e04cac Compare February 25, 2021 13:15
@nicolo-ribaudo nicolo-ribaudo changed the title Workaround yarn bug with self-referencing packages Workaround for self-referencing packages Feb 25, 2021
@nicolo-ribaudo nicolo-ribaudo merged commit 74db827 into babel:main Feb 25, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the workaround-self-ref branch February 25, 2021 16:33
@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 28, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: tests outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Fixes failing main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants