How to solve noscript - doesn't work properly without JavaScript enabled when serving a Vue App

浪子不回头ぞ 提交于 2020-12-05 05:02:11

问题


I'm setting up a new Vue.JS application using the Vue UI interface. When I start the application using vue serve src/App.vue the application starts but it only displays in the page the default Home | About. When I inspect the page in the HTML I see:

<noscript>
      <strong>We're sorry but basicapp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>

and in the console I see

[Vue warn]: Unknown custom element: <router-link> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <App> at src/App.vue
       <Root>

I am working with the basic application created when running the Vue UI

I am working with the basic application created when running the Vue UI If I run the application using the vue ui command followed by starting the application from the Vue UI it works.

The reason I want to open the application using the command line is that in Cloud9 where I want to test the application the vue ui starts on localhost and I cannot find a way to open it. The only changes I made to the application files were done only to make the application run inside the Cloud9 container: changed the package.jsonadded:

"dev": "webpack-dev-server --inline --progress --port 8080 --host 0.0.0.0 --config vue.config.js --public $C9_HOSTNAME",

created the vue.config.js and added:

module.exports = {
  devServer: {
    compress: true,
    disableHostCheck: true,
  },
}

回答1:


I found the problem. To start the application you need to run the command npm run serve. Works well in the Cloud9 container and also on my local machine.




回答2:


After 2.5 days of search I found that the content in index.html ( We're sorry but basicapp doesn't work properly without JavaScript enabled. Please enable it to continue. ) is not an error actually.

It is default text for those browsers in which javascript is not enable so don't worry about this at all.

To run your application in dev mode you can use Yarn serve command. If you want to build your application then use yarn/npm build and configure/use the index.html present in dist folder without any doubt.




回答3:


Change the port from 8080 to 8081,it worked for me. I opened another program with port 8080.May cause hash conflict




回答4:


This occured, when I accidentally set my web directory to the /public instead of the /dist directory. After I changed the apps root to point to the /dist directory in my nginx settings it worked fine.

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name mydomain.com;
    root /path/to/my/website/dist;

    # other settings below...
}



回答5:


You need to disable the adblocker or run on incognito mode




回答6:


'We're sorry but basicapp doesn't work properly without JavaScript enabled. Please enable it to continue.'

This Message will be shown when you open the Browser without javascript :D when you want to see it you should be disable The Javascript in your Browser



来源:https://stackoverflow.com/questions/55459339/how-to-solve-noscript-doesnt-work-properly-without-javascript-enabled-when-se

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!