Open pr0da opened 2 years ago
It is working well with 2.9.0-beta.7, but not with 2.9.0-beta.8. I think #7438 is affecting this. The reason is simillar to #7721, #7736.
@sapphi-red any update?
I've re-checked with the latest stable (2.9.12) and alpha (3.0.0-alpha.14) versions and it's still broken. This is kind of a deal breaker for us to upgrade and we stuck at 2.8.6.
It basically breaks libraries like luxon if any dependency also depends on / uses it. You can't use luxon instances interchangeably (eg. DateTime.isDateTime() will return false for DateTime instances created by the dependency).
I want to emphasise that this is DEV only, which also raises some concerns e.g.: different behaviour in prod / dev environment for the same code base.
Thanks for the update!
@pr0da There isn't any.
FYI I have found this workaround works.
export default {
resolve: {
alias: {
luxon: 'luxon/build/node/luxon.js'
}
}
}
Have the same problem with two instances of framer-motion, which breaks exit animations in dev mode
Describe the bug
Take the following dependency structure:
dep-a
should resolve to the same "instance" whether I access it directly (import depA from 'dep-a'
) or indirectly viadep-b
(e.g when it re-exports members fromdep-a
or returns adep-a
object, etc).In dev mode this does not seem to be the case. I got back two separate "instances" from the same package, with the same version.
See the attached example where
dep-a
isluxon@1.28.0
anddep-b
iscron-parser@4.3.0"
.I think this is a regression in 2.9.0:
vite@2.9.1: example: different behaviour in prod and dev mode
vite@2.8.6: example: works as expected
Luxon resolves to the same version (
yarn why luxon
):Reproduction
https://stackblitz.com/edit/vitejs-vite-n3tocb?file=package.json
System Info
Used Package Manager
yarn
Logs
No response
Validations