-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Uncaught Error: Function components cannot have string refs" when adding a "?ref=xyz" param to the base url #5497
Comments
I just took a look into it. I think we spread all the params and ref is being passed as a string redwood/packages/router/src/router.tsx Line 101 in 230f79d
redwood/packages/router/src/router.tsx Line 118 in 230f79d
|
@KrisCoulson Nice, that looks like what's happening indeed. I haven't thought about it much yet, but a solution that comes immediately to mind is renaming |
Same error here, running in production environment. In my case I can't control this URL param, it's inserted right after it's accessed from other URL, is there a workaround for this scenario? |
@arrbrk1 I'll prioritize getting feedback on #5537, in the meantime, your best option is to use ref-patch.mp4Or read along below. In your Redwood project:
Once you've opened the directory yarn gave you, navigate to the
Very important: make sure all versions of your redwoodjs packages are pinned to v2.2.3 (or whatever version you're using). Pinned means no caret (
Make sure it's fixed locally, then redeploy. (And when the patch comes out, undo all of that.) |
It worked, thank you! :) |
@arrbrk1 the patch with the fix just went out: https://github.com/redwoodjs/redwood/releases/tag/v2.2.4. When you upgrade be sure to get rid of the yarn patch file, or at least change the resolution so that it's just |
@ronatory I tried to reproduce, but I couldn't. Seems to work fine. Just had to do |
@Tobbe thanks for checking. I just didn't upgraded correctly to v3.0.0. Now I did and everything works fine 🎉 |
Seems to be easy reproducible. Just create a new redwood project and start the dev server via
yarn rw dev
and then add to the base url aref
parameter like this ->http://localhost:8910?ref=example
. Then the error in the title will occur ->Uncaught Error: Function components cannot have string refs
The text was updated successfully, but these errors were encountered: