InvalidArgumentException - View not found - laravel-5

recently I upload my laravel a server program, but from there I can not get into any form, only the grids, this why?

Check your filenames. Different operating systems and software versions work differently. For example: it might not be the same to return 'view.index' and 'view.Index'

Related

How should I handle serious errors in Vue components within Laravel apps?

[Clarified]
I'm writing my first Laravel app using Vue components; it is a CRUD. I know how to report significant problems to laravel.log via the Log::error("There is an error") technique but that's only useful while I'm in the PHP code; as far as I can figure out, there's no way to write to laravel.log from within a Vue component. (Correct me if I'm wrong!!)
This raises the question of how I should report an error in a Vue component in a Laravel app. I know about console.log(), Debugger for Chrome, and Devtools and those are fine for development. But what about errors that might reasonably happen in production? Clearly, user errors like bad input on a form needs to be dealt with by notifying the user and letting the user correct their input but some errors are beyond the user's scope. For example, it's not hard to imagine my Vue component failing to access the database because it is down for some reason. Shouldn't that kind of problem be written to a log so that whoever monitors production apps can deal with it?
How would a professional app deal with that kind of situation?
My initial inclination is just to write it to laravel.log if possible but that may be either impossible or be considered a bad approach. I'd be curious to know what experienced Laravel developers do in such situations. Maybe automatically sending a text to a support person would be a better approach. I'm really not sure how this should be handled in a modern professional way.
In any case, whoever is responsible for situations beyond the user's control needs to be told somehow so they can begin the steps that would be necessary to fix the problem. Furthermore, this person needs to be given sufficient details of what happened to be able to solve the problem. I expect that would include things like stacktraces, error codes, etc. I wouldn't want to send all of that as a stream of texts, I'd want it all to be accessible in a log of some kind. Then, you simply notify the support person that there is a problem of such-and-such severity which occurred at such-and-such a time and remind them where to find the details.
My approach may be dated though and newer, better alternatives may exist. Those are what I'm looking for with my question.
I can give a general purpose answer for your question.
React introduced the concept of ErrorBoundary,
Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed.
Using Error Boundary in Vue
use vue-error-boundary
This simple code of handleError method shows ErrorBoundary receiving a callback function through the on-error prop.
<template>
<ErrorBoundary :on-error="handleError">...</ErrorBoundary>
<template>
<script>
// ...
methods: {
handleError (err, vm, info) {
// do something
}
}
// ...
</script>
read the docs for the npm module to know more.
while handling errors, you can pass the errors to a link to your production site.
eg. /logging so it would be like https://www.example.com/logging, and post the errors in a format eg Date: Error File: Error Message.
You can even use authentication tokens along this link (though no one would use it as it would be frontend errors everyone can see it at console).
Then use routes to log those errors to laravel logs.

grails - Render doesn't work in production mode

My render works well in development when I deploy the application I have an exception:
HTTP Status 404 - /myApplication/WEB-INF/grails-app/views/myController/MyView.jsp
def myView(){
....
render(view: "MyView", model: [params:params])
return
}
I found a fixed issue in JIRA but I don't know if there is exactly the same issue:
http://jira.grails.org/browse/GRAILS-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
My environment:
GGTS: 3.3.0.RELEASE
Grails:2.0.3
apache-tomcat-6.0.37
As we figured out, it was because of inconsistent view name.
It's very likely that you're using a Windows for development, and a Linux for production. Windows is usually case-insensitive for filenames, but Linux is case sensitive (usually). So on production system myView.gsp and MyView.gsp is two different files, you must use same case for filename and in your code.

Codeigniter hiding errors from libraries. Why?

So I has a small problem as I outlined here.
I have made a new question because this is more general and will perhaps help others.
So essentially, I integrated the Facebook SDK Into Codeigniter as a library.
The SDK requires Json and Curl.
In the base_facebook.php file there is the following code:
if (!function_exists('curl_init')) {
throw new Exception('Facebook needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
throw new Exception('Facebook needs the JSON PHP extension.');
}
If these functions are not available I expect an error to be fired to tell me such. Then I can install the correct packages and continue.
What actually happened is that even when I had error reporting set to E_ALL a blank page was returned.
This made it impossible to debug and after lots of playing I worked out it was because CURL was not installed on my server.
My question is why does codeigniter show blank pages rather than library based exceptions?
Furthermore even if there is an exception in a library why does the rest of the page not continue executing.
Essentially CI is seemingly making the use of exceptions worthless..
COuld anyone advise?
THanks
My question is why does codeigniter show blank pages rather than library based exceptions?
Most likely because display_errors is set to “off”.
While this is recommended for a production environment (web site users are not supposed to see internal error messages – it might give them info about internals, that they are not supposed to have) – it’s not very helpful while developing, where you as the developer want to be informed about what went wrong.
So check if CI has a “debug” setting for this, or if it’s maybe already set to off in your PHP configuration.
(Maybe CI or your config are set up in a way that errors are logged to a file instead. Also recommended for production; while developing, you’d have to keep an eye on this file then.)
Furthermore even if there is an exception in a library why does the rest of the page not continue executing.
Because that’s how exceptions are supposed to work – if they are not being caught when they reach the “top level” of your app, they cause a fatal error, and scripts die when those occur.
Familiarize yourself with the concept of try { … } catch(…) { … } to handle exceptions that might occur in script flow.
(Actually, it’s kinda surprising you don’t know all this already, if you’re working with an advanced PHP framework …)

Codeigniter xml-rpc issue

I encountered a weird issue with CodeIgniter xml-rpc. If some data in the request contains system (xxx) it is automatically converted to system &140;xxx&140;
It only happens when you have word system followed by opening and closing brackets.
For example if I send Bachelor in Information system (BIS) it is received as Bachelor in Information system &140;BIS&141;
Just wondering if anyone else has ever had this issue or know anything about this.
Thanks
That is caused by the CodeIgniter XSS filtering which is activated by default. It happens because system() is a command in PHP to execute shell code.
Simple workaround (not recommended): Deactivate it in config.php
$config['global_xss_filtering'] = FALSE;
Better workaround: Deactivate it on a per-case base in your XML-RPC controller, so in the server part set
$this->config->set_item('global_xss_filtering',FALSE);

CodeIgniter Routing / Htaccess / URI issues

I recently joined a team of devs and I'm trying to get an SVN checked out onto my local machine. Unfortunately, I've run into some issues with links and routing. My local machine is using a WAMP setup.
Let's say I have in my controller:
function testfunc()($this->load->view('testfunc');
and in my testview view I have
<li>what we do</li>
At first, I was getting a URL disallowed characters issue. Thumbing through some threads, I added in rawencode($str) and some other things.
Now I get a 404 Page Found error, when the files are clearly there. It appears as though my controller isn't being called, and in turn the view is not called
Any suggestions?
Thanks.
You are missing the controller. Unless you are using some sort of routing, you should be using something like:
<li>what we do</li>
OR
<li><?php echo anchor('controller/testfunc', what do we do);?></li>

Resources