Vue suddenly reports an error doesn't work properly without JavaScript enabled

Suddenly an error is reported that JavaScript is not enabled

When I was demonstrating the project in the afternoon, I suddenly told me that JavaScript was not enabled, which embarrassed me on the spot;
insert image description here
then I wondered if there was a problem with the route guard I wrote, so I commented it out and tried again.
insert image description here
The problem is still there? !
Then after various operations, I found that the js was still reported as disabled, and I didn’t believe it on the spot! Then I reinstalled both yarn and node and restarted the computer! It's absolutely fine now!
Take a look at the project launch! Stupid on the spot! The problem is still there,
insert image description here
and then I fell into deep thinking, what is doing the trick? Then the search method is enabled! The answers on the Internet are full.
insert image description here
I found that I couldn't find what I wanted, so I will check them one by one! !

First check if it is a problem with vue, so I started a react

With the start of yarn start, the page is successfully displayed
insert image description here
. Well, now I don’t doubt that it’s a tool problem. It should be a problem with vue

So I went to see if there was a problem with the vue project, and then I created a new project

insert image description here
Hey, it's still okay! Then why does my project still report that JS is not enabled? ? ? ?
Then I checked the project carefully!

First of all, I look at each line in main!

It seems that the most suspect is mount! Because it is he who controls the page rendering,
insert image description here
then I went to the official document
insert image description here

Then I changed the ID in App.vue and found it was useless

Then I was thinking, this mount is not controlled here, so where is it controlled?

at last! ! ! ! !

It turns out that the id in the index entry file in the public is inconsistent with the element id mounted by mount, which leads to this error! ! !
insert image description here
insert image description here
Done!

Guess you like

Origin blog.csdn.net/JankoY/article/details/122489886