Closed MichalPleban closed 1 year ago
When connecting through remote debugger (Safari: Develop -> iPhone -> index.html), console output is always empty. I can execute JavaScript commands, and other tabs (like "Network") work as expected. But no console functions produce any output.
Can you clarify if the console outputs nothing at all (including console.log
executions after the inspector is attached) vs only console outputs that may have occurred before the inspector was attached.
If only the latter then it's not a bug, that's just how Safari works... Safari doesn't record log data if there is no attached inspector and doesn't display said information retroactively should an inspector be attached later. Therefore log information is only recorded and displayed after the inspector is attached. If you need to get "webview startup" console logs, then you will have to open the inspector, and press cmd + r to refresh the webview. This may cause some side effects in plugins but should also present you the console.logs that occurred while the HTML is loading.
It shows nothing at all, including console.log executions after the inspector is attached. After reloading the view with cmd+R there is also no console output whatsoever.
cordova-plugin-console: 1.1.0
I noticed you're using this console plugin which appears to override and clobbers the W3 console. This plugin is dated and deprecated. Can you remove this plugin and test to see if it solves your issue regarding the console?
It does not. It was like that before I installed the plugin, I installed it in the hope it would help but it makes no difference.
It does not. It was like that before I installed the plugin, I installed it in the hope it would help but it makes no difference.
Ok.
I just tried creating a sample hello world project to see if the issue reproduces on a simple project, which it does not (for me). Can you clarify if the issue reproduces on a physical device or simulators or both?
For what it's worth my environment is as follows:
Mac Mini 2023 M2
MacOS Ventura 13.3.1
XCode 14.3 (14E222b)
iPhone 14 Pro iOS 16.4 Simulator
Safari 16.4 (18615.1.26.11.23)
Node v18.5.0
NPM v9.5.0
I'd suggest trying to see if you can build a simplified project that reproduces the issue that you can share. It will help isolate the issue and if it's indeed a bug within the Cordova Framework, then it could potentially be used as a test case for a solution. Please see How to Create a Reproduction App for tips and rationale on what we are looking for.
Generally speaking, issues are often caused by plugins or a combination of plugins that may conflict or produce undesirable results, though looking at your plugin list nothing seems obvious. I'd recommend creating a sample project and incrementally start adding in plugins and changing the config.xml
configuration until the issue gets reproduced.
I have just created an empty project by running:
cordova create
cordova platform add ios
And the problem is already there. Even when I type console.log('...')
in the console, the output is not displayed.
Can you tell me the version of Safari you have on the Mac side?
I see that you're one minor version behind, so I'm thinking maybe your running Safari 16.3 and there is an incompatibility with iOS safari 16.4
Yes, I have Safari 16.3 on MacOS and 16.4.1 on iOS. I don't see any update for my Safari though in MacOS App Store :(
Yes, I have Safari 16.3 on MacOS and 16.4.1 on iOS. I don't see any update for my Safari though in MacOS App Store :(
Safari I'm pretty sure is tied to the OS, so you need to update your Mac to 13.3 most likely, which probably includes Safari 16.4. I am on MacOS 13.3 and it contains Safari 16.4 on my machine.
Alternatively, you can try the tech preview but that should be reserved as a last resource since it is a preview and may be unstable.
Thank you, it did the trick! After updating MacOS, the console works.
Bug Report
Problem
What is expected to happen?
Commands like console.log() are supposed to work.
What does actually happen?
When connecting through remote debugger (Safari: Develop -> iPhone -> index.html), console output is always empty. I can execute JavaScript commands, and other tabs (like "Network") work as expected. But no console functions produce any output.
Environment, Platform, Device
iOS 16.4
Version information
Cordova info output:
Checklist