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
{{ message }}
Repository navigation
Commit 54b4e80
Browse filesBrowse the repository at this point in the historyBrowse files
Don't include the version in module paths when serializing functions when using pnpm (#23767)
pnpm installs packages into a store keyed by version numbers
`node_modules/.pnpm/<pkg>@<version>/node_modules/<pkg>/...`, and adds a
symlink to this in `node_modules/<pkg>` so Node.js can resolve the
package.
The closure serializer sees the real path, not the symlink, and so would
write out code like
```javascript
cosnt ms = require(".pnpm/[email protected]/node_modules/ms/index.js”)
```
Since this includes the version number, when the package is updated, we
ended up with a diff on the serialized code. Even worse, if a package is
updated, and you run a pulumi operation that doesn’t run the program
(refresh, destroy), you could end up with an error because a dynamic
provider would fail to load some of its dependencies.
To fix this, we detect these paths and capture for example
`require("ms/index.js”)`, the same as under npm or yarn.
When updating the `@pulumi/pulumi` SDK to a version with this fix, users
will see one final diff that changes the `require` calls.
Fixes#10009Fixes#9085
Partial fix for #18976 (pnpm, not
the for packages in the `.aspect_rules_js` folder, which I think is
Bazel?)
0 commit comments