-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Grunt Serve Watch keeps triggering injection and livereload when there is an ajax call or js error #650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@nelsonomuto sorry for the delayed response, but I was wondering if you've made any changes to your grunt |
No problem, thanks for the reply. Actually I found the issue was a server redirect. In line 21 of the Disabling the configured redirect made it behave normal, I simply got a I had some views with templates pointing at non existent paths and the
|
To summarize if you attempt to load a file that does not exist but whose path is in any defined asset, then the response is the index.html. Which is confusing because this reloads and executes the scripts therein if you initially where loading said resource as a view or it was the source of a script tag or link to a stylesheet. For example this is my known asset that the route is using: So if in my client I attempt to load /containerapps/non-existentFile.js it will not return a 404 because this is a "defined" asset. Instead it will return index.html because in route.js there exists in line 21 this code: |
@nelsonomuto thats odd, I actually get a 404 when accessing anything listed in |
Can you show ur route.js file
|
Sure thing module.exports = function(app) {
// Insert routes below
app.use('/api/things', require('./api/thing'));
app.use('/api/users', require('./api/user'));
app.use('/auth', require('./auth'));
// All undefined asset or api routes should return a 404
app.route('/:url(api|auth|components|app|bower_components|assets)/*')
.get(errors[404]);
// All other routes should redirect to the index.html
app.route('/*')
.get(function(req, res) {
res.sendFile(app.get('appPath') + '/index.html', {
root: config.root
});
});
}; |
I'd like to point out that I'm using the newest express version which changes the |
Grunt Serve Watch keeps triggering injection and livereload when there is an ajax call or js error.
It seems like the page is reloading the script tags.
The text was updated successfully, but these errors were encountered: