yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.45k stars 2.73k forks source link

Yarn upgrade breaks @hot-loader/react-dom alias #7062

Open esetnik opened 5 years ago

esetnik commented 5 years ago

Do you want to request a feature or report a bug?

Bug

What is the current behavior? @hot-loader/react-dom is installed following instructions:

yarn add react-dom@npm:@hot-loader/react-dom

yarn outdated shows react-dom as exotic

❯ yarn outdated
yarn outdated v1.13.0
info Color legend :
 "<red>"    : Major Update backward-incompatible updates
 "<yellow>" : Minor Update backward-compatible features
 "<green>"  : Patch Update backward-compatible bug fixes
Package   Current Wanted Latest Package Type URL
react-dom 16.8.2  exotic exotic dependencies npm:@hot-loader/react-dom
✨  Done in 2.46s.

package.json before yarn upgrade:

{
  "dependencies": {
    "@hot-loader/react-dom": "^16.8.2",
    "react-dom": "npm:@hot-loader/react-dom",
  }
}

package.json after yarn upgrade:

{
  "dependencies": {
    "@hot-loader/react-dom": "npm:@hot-loader/react-dom",
    "react-dom": "npm:@hot-loader/react-dom",
  }
}

If the current behavior is a bug, please provide the steps to reproduce.

See above

What is the expected behavior? The package.json should not erase the alias

Please mention your node.js, yarn and operating system version.

❯ node -v && yarn -v && sw_vers
v10.15.0
1.13.0
ProductName:    Mac OS X
ProductVersion: 10.14.3
BuildVersion:   18D109
Jessidhia commented 5 years ago

I'm not sure but it just seems package aliases are behaving... strangely. Not sure if connected to workspaces, or to scoped packages.

I could reproduce it a few days ago with babel-preset-env@npm:@babel/preset-env, but I'm not affected anymore (for now) as I no longer need the hack.