console print some error when I deploy my blog to my website - vuepress

when I finished my vuepress blog and deploy to my website. chrome console always print out the following error message . it's doesn't seem to affect function. but I want to fix it . how can I do ?
console error

Do you trying remove a node of DOM manually?
i.e. document.getElementById("any-element").removeChild("other-element");
You shoudn't to do this, because the Vue is resposible for handling DOM.
But if you need do something like that, you must to verify if the window object exist. Because when you build the Vuepress site, Node.js do a prerender of all HTML files and in this context the window object doesn't exist.

Related

Remix: Warning: Extra attributes from the server: class

I am using remix and just created the most basic project by running npx create-remix#latest. Right out the gate, I get this in my console when running npm run dev.
Warning: Extra attributes from the server: class
It goes away after removing the <Scripts /> tag, but I think I need that?
That's a React error, it happens when you're hydration a server-side rendered HTML but the HTML doesn't match what React expected it to be when hydrating.
The most common reason for this to happen is when a browser extension is changing the HTML before React hydration process run.
Removing the Scripts components hide the error because you're not hydrating React client-side anymore.

Uncaught SyntaxError: Unexpected token '<' in app.js in Gcloud

I'm very new to Gcloud after 4 attempts I deployed local Laravel + Vue Project to Gcloud. It worked fine in local env, but the app showing blank page after deployment and the console showing below error message.
Uncaught SyntaxError: Unexpected token '<' app.js.
Even the resource files also not visible.
App link: https://fluted-vehicle-277421.el.r.appspot.com/
Can anyone suggest what went wrong?
This error typically gets thrown when in js file you have put html.
Try checking if you have html inside js file and remove it.
Regarding the error you mentioned in your post, as you can see here, this error is most likely the result of a 404 page or a redirect to a page that serves regular html instead of the JavaScript files.
On the other hand, I am not sure if you deployed a new version but currently, the error I see if I go to your site is "There is no existing directory at "C:\xampp\htdocs\LMS_project\storage\logs" and its not buildable: Permission denie". So, as I can see these errors are because you are not change correctly the paths in your app. You need to ensure the right paths in order to avoid this errors.

CanĀ“t open an internal page in Cypress Chrome

We have an cypress issue that is similar to the issue described in "https://github.com/cypress-io/cypress/issues/850". The reason for why I am creating a new post is that I have done some changes in the environment which makes this work but only after the first fail and then manually click on the failing URL.
Test1:
Default cypress\plugins\index.js file (no changes)
lauch the internal page cy.visit('xxx')
Error 401.
Click on the link below the error text. Another tab is opened and message UNAUTHORIZED is shown.
Paste same URL in default Chrome->works fine.
Test2:
Modify the cypress\plugins\index.js: args.push('--proxy-pac-url=xxx') (I have tested other arguments but this is the only one that makes something different)
Lauch the internal page cy.visit('xxx')
Error 403.
Click on the link below the error text. Another tab is opened and the page is shown CORRECTLY.
This is the reason why I post this new message. I want to ask if there is a way to get Cypress to open the page automatically via cy.visit() in the same way as when I click on the failing URL and it opens the page in the same cypress browser but just another tab?

Service worker Failed to load resource: net::ERR_UNSAFE_REDIRECT

would you please tell me what i did wrong with my service worker installation, i have those errors appear in chrome console (see the image-1).
The script resource is behind a redirect, which is disallowed. service-worker.js:1
Failed to load resource: net::ERR_UNSAFE_REDIRECT https://harampress.com/post/45/service-worker.js
i use Laravel framework in backend if that could help
just to know that my service-worker.js is in the root of the website, works fine on home page no errors on chrome console, but the moment i try to navigate to a post for example, those two errors appears (see image-2).
knowing that i use sw-precache and sw-toolbox, i generate the service worker useing sw-precache with gulp.
image-1
image-2
see the solutions here on github discussion
the message from the discussion in github that actually answered to my problem :
What #wanderview means is that when you do
navigator.serviceWorker.register('/sw.js')
The actual requesting URL is the sw.js located in the root
but when you do
navigator.serviceWorker.register('sw.js')
This is actually a Relative URL so what you actually request might be /post/blah/sw.js and your server might treat it as 404 and do some redirect.

Enabling Views custom module causes an Ajax HTTP error on Drupal 7

I'm working on a custom module that will describe an external table to the Views module. Inside my module folder I have the required mymodule.views.inc file. However, whenever this file is present and my custom module is enabled Drupal constantly gives Ajax HTTP Error pop ups when I use a site feature that has Ajax (any of the spinning daisies trigger this). The pop up always contains the module code in mymodule.views.inc after it says Ajax Error. The weird thing is every time I load the front page the PHP code in mymodule.views.inc is always displayed on the top of the front page.
I've seen this problem on SO and other sites a lot, but most of the time it can be traced back to an updated jquery.js file or a php.ini setting that will give scripts more time to run. So far neither of those fixes have worked. The only way I can make it go away for now is to either disable my custom module, or rename mymodule.views.inc to something else.
Here's an example of what the message looks like (not verbatim copy, since I can't copy from these alert messages in Chrome).
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /?q=admin/structure/views/view/viewiamtryingtocreate/preview/page/ajax
StatusText: parseerror
ResponseText: /*
* header file to my mymodule.views.inc
* file I wrote
*/
//more php code follows
//lots of unicode characters intermittently show up in my source code
\u003C\/div\u003E\n...
//source code continues with lots of unicode characters, not sure what's at the bottom because the alert box is bigger than my screen and I can't scroll on it
Does anyone else know what could be going on?
This error is caused by drupalforfirebug, disabling drupal for firebug should help. or else this patch should work.
Found it. Syntax error hiding at the top of mymodule.views.inc. There was some weird formatting before the opening PHP tag. Not sure why php --syntax-check mymodule.php didn't catch it (I copied mymodule.views.inc to mymodule.php so that I could run the syntax checker on it).

Resources