webdev icon indicating copy to clipboard operation
webdev copied to clipboard

client.js:10109 Unhandled error detected in the injected client.js script.

Open insinfo opened this issue 1 year ago • 8 comments

PS C:\MyDartProjects\new_sali> webdev --version
3.7.0-wip
PS C:\MyDartProjects\new_sali> dart --version
Dart SDK version: 3.6.0 (stable) (Thu Dec 5 07:46:24 2024 -0800) on "windows_x64"
PS C:\MyDartProjects\new_sali> 


client.js:10109 Unhandled error detected in the injected client.js script.

You can disable this script in webdev by passing --no-injected-client if it
is preventing your app from loading, but note that this will also prevent
all debugging and hot reload/restart functionality from working.

The original error is below, please file an issue at
https://github.com/dart-lang/webdev/issues/new and attach this output:

TypeError: null: type 'JSNull' is not a subtype of type 'String'

    at Object.wrapException (http://192.168.66.123:8080/dwds/src/injected/client.js:1249:43)
    at Object._asString (http://192.168.66.123:8080/dwds/src/injected/client.js:2823:15)
    at main__closure7.call$1 (http://192.168.66.123:8080/dwds/src/injected/client.js:26887:54)
    at _EventStreamSubscription_closure.call$1 (http://192.168.66.123:8080/dwds/src/injected/client.js:26250:26)
    at StaticClosure._rootRunUnary (http://192.168.66.123:8080/dwds/src/injected/client.js:4365:16)
    at _CustomZone.runUnary$2$2 (http://192.168.66.123:8080/dwds/src/injected/client.js:14412:39)
    at _CustomZone.runUnaryGuarded$1$2 (http://192.168.66.123:8080/dwds/src/injected/client.js:14359:14)
    at _CustomZone_bindUnaryCallbackGuarded_closure.call$1 (http://192.168.66.123:8080/dwds/src/injected/client.js:14546:25)
    at _callDartFunctionFast1 (http://192.168.66.123:8080/dwds/src/injected/client.js:7871:25)
    at http://192.168.66.123:8080/dwds/src/injected/client.js:7847:18

:8080/$dwdsSseHandler?sseClientId=InjectedClient-8665e965-a744-479a-a760-05062a75f24e:1 
        
        
       GET http://192.168.66.123:8080/$dwdsSseHandler?sseClientId=InjectedClient-8665e965-a744-479a-a760-05062a75f24e net::E

pubspec.yaml

name: new_sali_frontend
version: 4.0.0
publish_to: none

environment:
  sdk: ^3.2.1

dependencies:
  ngdart: 8.0.0-dev.4
  ngrouter: 4.0.0-dev.3
  ngforms: 5.0.0-dev.3   
  #ngdart:     
    #git:
      #ref: master
      #url: https://github.com/insinfo/angular_8.git
    # path:
    #   ../../angular_8
  
  http: any  
  js: any  
  chartjs2: any  
  #ngsecurity:
   #git:
      #ref: main
      #url: https://github.com/angulardart-community/ngsecurity.git 
      #url: https://github.com/insinfo/ngsecurity.git 
  new_sali_core:
    path: ../core
  dart_excel:
   git:
    url: https://github.com/insinfo/dart_excel.git
    ref: main    #branch name  
        

dev_dependencies:  
  build_runner: ^2.1.2
  build_test: ^2.1.3
  build_web_compilers: ^4.0.0
  lints: ^2.1.0
  test: ^1.24.0
  sass_builder: ^2.2.1
  

insinfo avatar Dec 22 '24 20:12 insinfo

From what I saw, the error occurs right after clicking on a form item after the application is fully loaded.

image

Microsoft Edge Versão 131.0.2903.112
Google Chrome Versão 130.0.6723.117

https://github.com/user-attachments/assets/06242837-21b0-486d-a97a-089798b1e992

insinfo avatar Dec 27 '24 14:12 insinfo

Doing something like this for injected client would be useful to debug these issues: https://github.com/flutter/devtools/pull/8385

My suspicion is that this JSNull type error is related to the migration to package:web https://github.com/dart-lang/webdev/pull/2530/files

elliette avatar Jan 08 '25 18:01 elliette

Same issue. Any update?

pedrisbel avatar Jun 04 '25 14:06 pedrisbel

Unable to replicate in flutter 3.32.4 @insinfo do you still had the issue?

adonisRodxander avatar Jul 18 '25 23:07 adonisRodxander

my application is a full stack web application with dart using ngdart (AngularDart) https://pub.dev/packages/ngdart/versions/8.0.0-dev.4 on the frontend and https://pub.dev/packages/angel3_framework angel3_framework 8.5.0 on the backend, in principle I am no longer having these problems with dart 2.6.2 and webdev 3.7.1

insinfo avatar Jul 21 '25 00:07 insinfo

I have an example project here at this URL, maybe you can replicate this problem by cloning this repository https://github.com/insinfo/full_stack_dart_app

insinfo avatar Jul 21 '25 00:07 insinfo

maybe the problem was in some dependency that was fixed and is being downloaded with dart pub upgrade

insinfo avatar Jul 21 '25 00:07 insinfo

We're not 100% sure why we see this issue, but typically a full clean and rebuild resolves it.

bkonyi avatar Jul 25 '25 15:07 bkonyi