-
Notifications
You must be signed in to change notification settings - Fork 444
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
In preview mode, strings from sanity are coming back with invisible characters #6227
Comments
The hidden characters are part of the design when using Visual Editing and is how the Content Source Maps are transferred to the DOM and then picked up by the You can fix this by either:
Or by adjusting the
|
@stipsan Thank you so much for the explanation! We can stop scratching our heads! 🙏 🙇♂️ |
@karltaylor Great to hear! We're updating the default filter to catch use cases like yours: sanity-io/client#689 😉 |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
I'm just pulling this #5782 discussion into issues as we are seeing this more and more with more strings as we're developing for production and would love to get some light shed on the situation.
We're using sanity strings as slugs to determine layout or render a specific component, during development and production builds this is fine, for example:
However, we have discovered that when in live preview mode, the console log was
false
. After pulling our hair out, we discoveredmediaType
in preview mode has invisible characters in, breaking UI.This image is me copying the above value in the object, and pasting it back into the console, revealing the invisible characters.
We are now resorting to doing all checks using
include
, e.gTo Reproduce
Steps to reproduce the behavior:
If required, I can setup a repo.
Expected behavior
Strings to not return invisible characters
Screenshots
See above
Which versions of Sanity are you using?
Run
sanity versions
in the terminal and copy-paste the result here.What operating system are you using?
MacOS Sonoma 14.3 (23D56)
Which versions of Node.js / npm are you running?
Run
npm -v && node -v
in the terminal and copy-paste the result here.Additional context
Using
"turbo": "^1.13.2"
Security issue?
At this time I do not believe this is a security issue.
The text was updated successfully, but these errors were encountered: