You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jest erroneously treats reproduction-example/needs-preserved-id and reproduction-example/has-browser-field/needs-preserved-id as distinct modules if has-browser-field specifies a browser field and the browser: true Jest config option is used.
If browser: false, then module identity is preserved as expected (#4761).
Expected behavior
Module identity should be preserved for symlinks when browser: true.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
π Bug Report
Jest fails to preserve module identity for symlinks when using the
browser
package.json field.To Reproduce
Suppose we have the following dependency graph and these packages are installed via symlinks:
Jest erroneously treats
reproduction-example/needs-preserved-id
andreproduction-example/has-browser-field/needs-preserved-id
as distinct modules ifhas-browser-field
specifies abrowser
field and thebrowser: true
Jest config option is used.If
browser: false
, then module identity is preserved as expected (#4761).Expected behavior
Module identity should be preserved for symlinks when
browser: true
.Link to repl or repo (highly encouraged)
Minimal repository: https://github.com/rtsao/jest-bug-repro-preserve-symlinked-module-ids
This reduced example demonstrates module identity being preserved correctly with
browser: false
but not withbrowser: true
envinfo
The text was updated successfully, but these errors were encountered: