Custom formatter logging not works in Vue SFC Playground
Vue version
3.3.9
Link to minimal reproduction
Steps to reproduce
- Open Chrome dev tools and enable custom formatter
- Run playground and see the console log
- You will see the
msg
ref is not been formatted
What is expected?
Show formatted logging
What is actually happening?
Showing unformatted loggin
System Info
No response
Any additional comments?
No response
They seem to work in development mode (click the PROD/DEV button). I'd imagine the custom formatters aren't included in a production build.
Or were you expecting the Playground to add them itself in production mode?
Oh it really works in DEV mode.
I'm not sure if SFC Playground should have a custom formatter added in PROD, because the default mode is PROD, and sometimes I just want to log some values there for testing. I would also like to hear other people's opinions.
After https://github.com/vuejs/core/commit/fc7902982a4bc9f0c9cdb0c9c222bc43a9d5c458 (which is a relatively recent change), the PROD flag now also uses the corresponding production build of Vue to best simulate production behavior. This means all dev-only logic, including warnings and custom formatter, is tree-shaken. So this is expected behavior.