Title: imported name renamed with $1 suffix in generated code, but not in all cases · Issue #613 · unplugin/unplugin-auto-import · GitHub
Open Graph Title: imported name renamed with $1 suffix in generated code, but not in all cases · Issue #613 · unplugin/unplugin-auto-import
X Title: imported name renamed with $1 suffix in generated code, but not in all cases · Issue #613 · unplugin/unplugin-auto-import
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 ...
Open Graph 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...
X 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...
Opengraph URL: https://github.com/unplugin/unplugin-auto-import/issues/613
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"imported name renamed with $1 suffix in generated code, but not in all cases","articleBody":"### Describe the bug\n\nHard to pin down what is exactly happening, but reporting just to leave a trace in case others run into it.\n\nI have a spread in `computed` like\n\n```\n...mapStores(useMyStore)\n```\nand that works fine.\n\nBut if I put the useMyStore on a separate line, like\n```\n...mapStores(\n useMyStore\n)\n```\nthen 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.\n\nWhat 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.\n\nIf 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.\n\n### Reproduction\n\ntried, but couldn't\n\n### System Info\n\n```Shell\nunplugin-auto-import 20.3.0\nvite 7.2.7\nvue 2.7.16\n```\n\n### Used Package Manager\n\nnpm\n\n### Validations\n\n- [x] Follow our [Code of Conduct](https://github.com/antfu/.github/blob/main/CODE_OF_CONDUCT.md)\n- [x] Read the [Contributing Guide](https://github.com/antfu/contribute).\n- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.\n- [x] Check that this is a concrete bug. For Q\u0026A, please open a GitHub Discussion instead.\n- [ ] The provided reproduction is a [minimal reproducible](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.","author":{"url":"https://github.com/robinp","@type":"Person","name":"robinp"},"datePublished":"2025-12-13T23:06:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/613/unplugin-auto-import/issues/613"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6a14665e-0712-4abe-9efe-045ec3a7b9c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F48:1AC151:23A539E:306FC3F:69808008 |
| html-safe-nonce | 70a15e622960655588cc42ff085f72c71923a832f0e8de352e604b1039dae533 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjQ4OjFBQzE1MToyM0E1MzlFOjMwNkZDM0Y6Njk4MDgwMDgiLCJ2aXNpdG9yX2lkIjoiMjcyODQwNzk4OTc4NTQ5MzUxMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1c47b38f402b711bef94ade1e722787442150038be0703eb82e955abec857f89 |
| hovercard-subject-tag | issue:3726483566 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/unplugin/unplugin-auto-import/613/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c9c37c259add6fd13b9381ce4812a73f3b9ce03ebd47ebe3e7c92f1ac598086e/unplugin/unplugin-auto-import/issues/613 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c9c37c259add6fd13b9381ce4812a73f3b9ce03ebd47ebe3e7c92f1ac598086e/unplugin/unplugin-auto-import/issues/613 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | robinp |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4590f1c00c56e5b3a3460b81e4236454a157a2159793b09a2ddee090670e75fb |
| turbo-cache-control | no-preview |
| go-import | github.com/unplugin/unplugin-auto-import git https://github.com/unplugin/unplugin-auto-import.git |
| octolytics-dimension-user_id | 143585159 |
| octolytics-dimension-user_login | unplugin |
| octolytics-dimension-repository_id | 399356027 |
| octolytics-dimension-repository_nwo | unplugin/unplugin-auto-import |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 399356027 |
| octolytics-dimension-repository_network_root_nwo | unplugin/unplugin-auto-import |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 242fda17fe105562f9eb7fe91a7a0dca07c527b3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width