dart-lang / webdev

A CLI for Dart web development.
https://pub.dev/packages/webdev
213 stars 71 forks source link

Unhandled error when trying to debug from IDX #2444

Open jmiller-pwi opened 1 month ago

jmiller-pwi commented 1 month ago

Description:

Encountered an unhandled error in the injected client.js script while debugging a Flutter application in Google IDX, with the Google Chrome web browser. The error message suggests a SecurityError, stating that the construction of a WebSocket failed due to attempting to initiate an insecure connection from a page loaded over HTTPS.

IDX version: 1.83.1 Chrome version: 125.0.6422.142

Steps to Reproduce:

  1. Start debugging a Flutter application in Google IDX.
  2. Monitor the console output for any errors.
  3. Observe the error related to the construction of a WebSocket and the SecurityError message.

Expected Behavior:

Debugging should proceed smoothly without encountering any unhandled errors related to WebSocket construction.

Actual Behavior:

Encountered an unhandled error in the injected client.js script, specifically related to WebSocket construction and SecurityError.

Additional Information:

The error message suggests that disabling the injected client.js script using the --no-injected-client flag in webdev might resolve the issue, but it would also disable debugging and hot reload/restart functionality.

SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS. Error: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS. at Object.HtmlWebSocketChannel$connect (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:9617:19) at https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:25846:106 at _wrapJsFunctionForAsync_closure.$protected (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:4049:15) at _wrapJsFunctionForAsync_closure.call$2 (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:12422:12) at Object._asyncStartSync (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:4013:20) at main_closure.call$0 (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:25904:16) at StaticClosure._rootRun (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:4416:16) at _CustomZone.run$1$1 (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:13809:39) at Object.runZonedGuarded (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:4527:88) at main (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:9675:16) at https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:27966:7 at https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:27949:7 at dartProgram (https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:27960:5) at https://35165-idx-pwi-airtable-sync-flutter-1716983295689.cluster-joak5ukfbnbyqspg4tewa33d24.cloudworkstations.dev/dwds/src/injected/client.js:27968:3

jmiller-pwi commented 1 month ago

Related to or duplicates #2435