-
-
Notifications
You must be signed in to change notification settings - Fork 221
Description
Describe the bug
Hard to pin down what is exactly happening, but reporting just to leave a trace in case others run into it.
I have a spread in computed like
...mapStores(useMyStore)
and that works fine.
But if I put the useMyStore on a separate line, like
...mapStores(
useMyStore
)
then it is problematic. Unfortunately this isn't standalone, it needs using useMyStore in some way in an other module in a larger project. I tried with a minimal project, but couldn't prod a setup that repros so far.
What seems to happen is that the generated bundle will take the useMyStore as a closure (... u as useMyStore) normally, but in the bad case, it is passed as u as useMyStore$1. Actually all the uses are renamed to useMyStore$1 too, so that's fine, but the above mentioned single-line-formatted spread is left out and left as useMyStore, which is then not found.
If I remove either of the newlines around the single useMyStore, so a paren is immediately on the same line, the problem stops happening. Very odd.
Reproduction
tried, but couldn't
System Info
unplugin-auto-import 20.3.0
vite 7.2.7
vue 2.7.16Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.