Skip to content

Conversation

MrSunshyne
Copy link

@MrSunshyne MrSunshyne commented Aug 19, 2025

fixes: #2122

I've tried several ways of referencing useId, [bracketNotation], .doNotation(), but they all keep failing. This dynamic property access works and the error no longer appears.

@MrSunshyne MrSunshyne marked this pull request as ready for review August 19, 2025 11:51
Copy link
Contributor

@cyyynthia cyyynthia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is problematic as it completely wrecks treeshaking abilities of Vue. This is something that occurred before, that I had to fix by sending a patch to Rollup directly (and other bundlers such as Rolldown can't properly optimize the current gate). Rollup REPL - Rolldown REPL

The proper fix would be for rspack to not be a b!#@/h about missing exports when accessing them this way, and instead do the sensible thing of just treating it as undefined like a normal bundler... :)

While upstreaming a patch to Rollup to optimize this would be relatively trivial, it'd be in the best interest of everyone's sanity that a solution that isn't a source of major deoptimizations of the final bundles downstream users... 😕

@MrSunshyne
Copy link
Author

thanks for pointing these out @cyyynthia. I did notice the recent PR that deals with the issue you mentioned.

I'd be happy to take a look at the upstream issue too, but i'm just getting started to understand bundlers and not even sure where to get started rn.

Until this is fixed upstream in rspack, it would mean reka-ui is only compatible with >= Vue 3.5 unlike specified here ?

@sadeghbarati
Copy link
Collaborator

sadeghbarati commented Sep 5, 2025

https://github.com/vueuse/vue-demi

Maybe we could use vue-demi's way, postinstall, for replacing the content of the JS file based on the Vue version


A curious question: Can we build the package when the user tries to install the package?

  • user tries to install the pkg with any package manager

  • an unknown tool :) for checking the user's package.json or project data ( a middleware or intermediary tool, or vite environment, or nitro or something like shadcn CLI or pkg.pr.new but on user side 😶‍🌫️ )

  • then build the package based on the data, and then return the tarball file to install in the node_modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: useId check is failing when the project's Vue version is less than 3.5
3 participants