Flutter Web - error output points to JS file instead of dart file - android-studio

I have a Flutter Web project, and when an error is thrown, I can't open the dart file where the error was thrown, because the error line points to a JS file:
Launching lib\main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
This app is linked to the debug service: ws://127.0.0.1:63045/gOvW2paMrLg=/ws
Debug service listening on ws://127.0.0.1:63045/gOvW2paMrLg=/ws
Running with sound null safety
Debug service listening on ws://127.0.0.1:63045/gOvW2paMrLg=/ws
Error: Invalid argument(s): A value must be provided. Supported values: 0, 1
at Object.throw_ [as throw] (http://localhost:53846/dart_sdk.js:5061:11)
at Object._$36enumDecode [as _$enumDecode] (http://localhost:53846/packages/web_app/core/models/pessoa/pessoa.dart.lib.js:482:17)
at Object._$36PessoaFromJson [as _$PessoaFromJson] (http://localhost:53846/packages/web_app/core/models/pessoa/pessoa.dart.lib.js:473:54)
at Function.fromJson (http://localhost:53846/packages/web_app/core/models/pessoa/pessoa.dart.lib.js:375:21)
at http://localhost:53846/packages/web_app/repository/pessoa_repository.dart.lib.js:60:193
at repository.RepositoryGetter.new.getRecurso (http://localhost:53846/packages/web_app/repository/repository.dart.lib.js:33:18)
at getRecurso.next (<anonymous>)
at http://localhost:53846/dart_sdk.js:38640:33
at _RootZone.runUnary (http://localhost:53846/dart_sdk.js:38511:59)
at _FutureListener.thenAwait.handleValue (http://localhost:53846/dart_sdk.js:33713:29)
at handleValueCallback (http://localhost:53846/dart_sdk.js:34265:49)
at Function._propagateToListeners (http://localhost:53846/dart_sdk.js:34303:17)
at _Future.new.[_completeWithValue] (http://localhost:53846/dart_sdk.js:34151:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:53846/dart_sdk.js:34172:35)
at Object._microtaskLoop (http://localhost:53846/dart_sdk.js:38778:13)
at _startMicrotaskLoop (http://localhost:53846/dart_sdk.js:38784:13)
at http://localhost:53846/dart_sdk.js:34519:9
How can I make it to show the dart file where the error occurred, instead of a JS file?
I'm using Flutter Channel stable 2.5.2, Android Studio version 2020.3.

I have found a workaround for this issue.
You basically have to install a third-party patch; it will translate the paths in JS and point to the right line in dart file.
Download the patch and follow the instructions here: https://github.com/obeobe/flutter-web-exception-mapper

Optionally you can see trace of dart files in the browser.
Make sure you have source maps enabled in your browser.
got the answer from this link on github

Related

Hello Folks: I am having problem in starting sails app in nodejs. can anyone put forth their insights on that?

I tried running the latest version of node and postgresql, but was having problem i deprecated node to 13.12.0 and sails-postgresql to 1.0.2 as mentioned in one of the blog. still the error is coming. Stack trace is as below:
sails lift
info: Starting app...
(node:10460) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
info: Initializing apianalytics hook... (requests to monitored routes will be logged!)
info: ·• Auto-migrating... (alter)
info: Hold tight, this could take a moment.
error:
error: Error: Sails is taking too long to load.
Troubleshooting tips:
-• Were you still reading/responding to an interactive prompt?
(Whoops, sorry! Please lift again and try to respond a bit more quickly.)
-• Do you have a lot of stuff in assets/? Grunt might still be running.
(Try increasing the hook timeout. Currently it is 40000.
e.g. sails lift --hookTimeout=80000)
-• Is blueprints a custom or 3rd party hook?
(If initialize() is using a callback, make sure it's being called.)
at Timeout.tooLong [as _onTimeout] (C:\Users\dearm\OneDrive\Desktop\my work\sails-logrocket\myapp\node_modules\sails\lib\app\private\loadHooks.js:191:21)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
error: Could not load Sails app.
error:
error: Tips:
error: • First, take a look at the error message above.
error: • Make sure you've installed dependencies with npm install.
error: • Check that this app was built for a compatible version of Sails.
error: • Have a question or need help? (http://sailsjs.com/support)
complete code is here https://github.com/mannawar/sails_app
Try using Node version 10 and sails-postgresql version 2.0.0

jsreport failing on looking up extensions

So I recently started working on a linux machine (ubuntu 16.04) and followed the installation instructions here http://jsreport.net/downloads/. When I run npm start --production I get
2016-09-13T16:51:57.134Z - info: Initializing jsreport in production mode using configuration file prod.config.json
2016-09-13T16:51:57.138Z - info: Setting process based strategy for rendering. Please visit http://jsreport.net/learn/configuration for information how to get more performance.
2016-09-13T16:51:57.146Z - info: Searching for available extensions in /home/ross/rifiniti/optimo_ui/
2016-09-13T16:51:57.152Z - info: Extensions location cache not found, crawling directories
2016-09-13T16:51:57.317Z - error: Error occured during reporter init Error: ENOENT, no such file or directory '/home/ross/rifiniti/optimo_ui/ember/tmp/tree_merger-tmp_dest_dir-2yGnPLMA.tmp/optimo-ui/config'
at Error (native)
at Object.fs.statSync (fs.js:801:18)
at /home/ross/rifiniti/optimo_ui/node_modules/jsreport/node_modules/jsreport-core/lib/util/util.js:51:21
at Array.forEach (native)
at Object.exports.walkSync (/home/ross/rifiniti/optimo_ui/node_modules/jsreport/node_modules/jsreport-core/lib/util/util.js:44:10)
at /home/ross/rifiniti/optimo_ui/node_modules/jsreport/node_modules/jsreport-core/lib/extensions/locationCache.js:50:20
From previous event:
at /home/ross/rifiniti/optimo_ui/node_modules/jsreport/node_modules/jsreport-core/lib/reporter.js:90:8
From previous event:
at Reporter.init (/home/ross/rifiniti/optimo_ui/node_modules/jsreport/node_modules/jsreport-core/lib/reporter.js:69:30)
at Reporter.reporter.init (/home/ross/rifiniti/optimo_ui/node_modules/jsreport/lib/extendInit.js:8:21)
at Object.<anonymous> (/home/ross/rifiniti/optimo_ui/server.js:1:85)
And I have no idea why. It was working fine on mac but now it is looking for this non-existent tmp file in ember. I'm at a loss, any help would be greatly appreciated!
SOLVED!
All I had to do was remove the tmp directory in ember and it worked.

Preverification Failed - J2ME Project

I am working on a J2ME project in Netbeans. I am having a problem in buiding the project. Whenever I ties to build it, it's giving me preverification error. below are the logs.
Executable: C:\WTK2.5.2\bin\preverify
Arguments : -classpath "C:\J2ME Client USE\S60CnB\lib\jsr257.jar;C:\J2ME Client USE\S60CnB\lib\JSR257Ext.jar;C:\WTK2.5.2\lib\mmapi.jar;C:\WTK2.5.2\lib\jsr75.jar;C:\WTK2.5.2\lib\cldcapi11.jar;C:\WTK2.5.2\lib\jsr239.jar;C:\WTK2.5.2\lib\midpapi20.jar;C:\WTK2.5.2\lib\jsr179.jar" -d "C:\J2ME Client USE\S60CnB\ec09b2f6.tmp" -target CLDC1.1 "C:\J2ME Client USE\S60CnB\build\NKTej2.jar"
JAR file creation failed with error 1
The preverified classes if any are in tmp26379. See jar log of errors in C:\J2ME Client USE\S60CnB\ec09b2f6.tmp\jarlog.txt
Error preferifying, attempting to print C:\J2ME Client USE\S60CnB\ec09b2f6.tmp\jarlog.txt
====C:\J2ME Client USE\S60CnB\ec09b2f6.tmp\jarlog.txt====
java.io.FileNotFoundException: tmp26379\META-INF\MANIFEST.MF (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
at sun.tools.jar.Main.run(Main.java:148)
at sun.tools.jar.Main.main(Main.java:1147)
Error: No error
jar -cfm "C:\J2ME Client USE\S60CnB\ec09b2f6.tmp\NKTej2.jar" tmp26379\\META-INF\MANIFEST.MF -C tmp26379 .
C:\J2ME Client USE\S60CnB\build.xml:146: Preverification failed (result=1)
Please help me out.
please details of your program. Which UI are you using? Have you gone through your program to see their is no bug? Have you successfully embedded the oracle sdk plugins for netbeans?
These are the possible problem. If it persists, reply...
J2me tutorial at http://www.tutorialmasterng.blogspot.com

Running Grails 2.3.1 in debug mode from linux

I'm trying to run Grails 2.3.1 en debug mode either from console or IntelliJ IDEA 12, but I always get the following error:
grails run-app --debug-fork
| Running Grails application
ERROR: transport error 202: bind failed: Address already in use
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:750]
First of all I configure my IDEA Debug mode.
For grails <2.4
I'm doing next:
1. grails-debug run-app
It's opening port 5005 and waiting for your IDE to connect
2. Go to IDEA and hit "bug" button
3. Your grails console automatically runs application
For grails 2.4
1. "grails --debug run-app"
2. Hit "bug" button
I solved it as follows
i switched and reswitched the grails version with gvm default ...
i checked a fresh copy

issue with running java me source code on emulator

I just finished installing all the necessary tools for Java ME and I am getting the following error:
Installing suite from: http://127.0.0.1:58255/Homework1.jad
*** Error ***
A problem occured during deploying application from http://127.0.0.1:58255/Homework1.jad
Reason:
Either the configuration or profile is not supported.
It can be either the configuration or profile.
Compare the Microedition Configuration (CLDC) and Microedition Profile at Application Descriptor against your Device Configurations in Project->Properties->Java ME->Edit
They should be the same.

Resources