How to make Vue error show the exact error source line in the code? - vue.js

I am using Nuxt to develop an application.
Currently, when I ran into error, the stack trace looks like this.
This is very difficult to debug and find the error.
Is there any way to make it show the source file, the function, or the line that is causing the error?

Related

How to solve crashes in Google Play Console?

In Google Play Console on the dashboard of your application there
is a graph with Crashes & ANRs.
What is the best practice to solve
crashes to provide the best service to your users? My application is
written in Python in Kivy framework.
Navigate to Quality -> Android Vitals -> Crashes and ANRs.
This lists each event and on the right you will see a "->" arrow labelled "View Details".
Click this, scroll down past the graph and you'll see the Stack traces.
This is what you need to look at to fix your code.
The top line will be the error, then it'll show the line of code where the error occurred, for example:
[code]
java.lang.NullPointerException:
at com.test.MyApp.doSomethingCool (MyClass.java:123)
at com.test.MyApp.somethingElse (AnotherClass.java:321)
[/code]
Here you have some null value causing an issue in the "doSomethingCool" function of your app and that code should be on line 123 of "MyClass.java".
The trace lines after that show what called that function that failed, so above, this is showing that "doSomethingCool" was called from function "somethingElse" on line 321 and that code is in "AnotherClass.java".
This example is for Java.
--Updated--
If you are coding in Python, then the stack trace may not show you where in your own code the problem lies. Instead your best bet is to search on Google for the top line error and hope that the answer is online.
Separately from stack trace analysis I would highly recommend that you place your project into source control with GIT or SVN, specifically so that you can see what changes might have caused an error.
Update your code in the repository only when it's working and then you will always have a safe saved version that is known as working. You can then easily compare your current code and see what changes might have caused an error. This is especially useful for Android, which regularly updates versions of shared libraries.

Prestashop PHP Smarty Errors

My error_log file keeps getting filled with this error and i don't know what is causing it. Any idea how i can find what is causing the error ?
[14-Aug-2020 13:20:32 Europe/Bucharest] PHP Fatal error: Uncaught --> Smarty: 0():Missing '$template' parameter <--
thrown in /home/website/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php on line 177
It means somewhere in the code there is a variable called {$template} which is not defined. It could be theme templates or modules
I would use IDE to look for this variable. If this doesnt work just go for debuging technique, start where smarty starts rendering and go till place where it crashes :)
It looks like it is a dublicate for this question, maybe will help
SmartyException 0():Missing '$template' parameter with Prestashop
This also might be due to messed up module structure, its ModuleFrontControllers etc.
You can try to edit this file:
thrown in /home/website/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php on line 177
and check if you can log more informations about an error, file path etc.

Getting the following error: Unable to resolve "../assets/icon.png" from "app\assets\screens\WelcomeScreen.js"

When I try to run my app I get the error
Unable to resolve "../assets/icon.png" from "app\assets\screens\WelcomeScreen.js"
Error: Problems validating asset fields in app.json. See https://docs.expo.io/
• Field: icon - cannot access file at './assets/icon.png'.
I created a screens folder and input my homescreen into it as I heard that the majority of the react native community does things that way. Attached is a picture of my filesenter image description here
I think that the image path is off, however I had changed it multiple times and am still getting the same error.
Any help would be appreciated.
try the following: ../icon.png
Cause that's what I can see from your file structure.
If you use visual studio code as dev tool, when you type path cue, correct path will be appeared. so you can avoid to make mistake in path of image.

Logging Current Directory/Filename in React Native

I was wondering if there is a way to log the current filename or directory in React Native. Similar to how NodeJS does it with __filename and __dirname.
No, it's not possible since all the source code gets bundled together into one big file, and then a source map is provided so that you can debug it in the original structure.
You can see that by calling this code snippet somewhere in your code:
console.log(new Error().stack);
In a regular javascript you would get the entire trace with files and line numbers, but in react-native you get somthing like:
Error
at Login (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:83009:9)
at instantiate (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:5712:18)
at new Login (eval at proxyClass (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:5730:16), <anonymous>:4:17)
at ReactCompositeComponentWrapper._constructComponentWithoutOwner (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:22051:19)
at ReactCompositeComponentWrapper._constructComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:22033:13)
at ReactCompositeComponentWrapper.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:21952:15)
at Object.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:20425:29)
at ReactCompositeComponentWrapper.performInitialMount (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:22134:28)
at ReactCompositeComponentWrapper.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:22015:13)
at Object.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false:20425:29)"
which shows you the real files are gone.

Package not found but its there

import org.flarrison.scripts.flarrifarm.tasks.livid.DetectLivid;
I'm getting a Package not found error. It doesn't show up as error before i compile. I used the auto completion for it to import. I even clicked CTR-Z until i got back to where the script did run. But it's not now and i have no clue what to do.
Is there any way to get it to recognize it's there? Because it definitely is.
Its telling me that the package "livid" isn't there. BUT IT IS!