You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@hcw0915 I took a look at what might be going on here and I think there are a couple of problems:
It doesn't look like the Sandpack Console supports styling the console output like the standard browser console (go to the section Styling console output)
With all that said, I'd say the issue is on the Sandpack side since we're not processing string replacements or console styles. I made a sandbox to show the problem based on the comments above: https://codesandbox.io/p/sandbox/sandpack-issue-1123-tlrpqy. If you notice, the logs on the inside of the component are run twice with the second set having the styles added while the logs on the outside of the component are only run once. Also, if you try to manually add the formatting (i.e. %c), it won't work.
I think there are some options we could take:
Update the Sandpack Console component to handle string replacements and console styles (i.e. re-implement the browser's logic -- which may be non-standard)
Filter out string replacements and console styles before rendering the list of logs
Leave it as is and update the Limitations section of the Sandpack Console docs to explain what's happening
Given there's already a suggestion to use the console-feed package to address other limitations, I'd think number 3 above would make sense, but I think that's a decision for the core maintainers.
Bug report
Packages affected
resolutions
)Description of the problem
the console would log out some text
%c%s
color: rgba(125, 125, 125, 0.5)
but if i click the
Open Sandbox
redirect to codesandbox.ioi think that it is becaue of the
strict mode
, but how can i turn off it in<sandpack/>
What were you doing when the problem occurred?
What steps can we take to reproduce the problem?
Link to sandbox: link (optional)
Your Environment
The text was updated successfully, but these errors were encountered: