Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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,
  },
}
like image 275
Alexandru Nutu Avatar asked Apr 01 '19 16:04

Alexandru Nutu


People also ask

Does Vue need JavaScript?

With Vue. js it's as easy as pie, because it relies only on JavaScript and doesn't require any other tools to work. Vue also allows you to write the templates as you wish: using HTML, JS, or JSX (JavaScript syntax extension). Between its components and lightweight nature, Vue can be used in nearly any project.

Is Vue js the same as JavaScript?

Vue. js grew from a one-man project to one of the most adored JavaScript frameworks in just a few years. First publicly released in 2014 by ex-Googler Evan You, Vue. js is an open-source front-end JavaScript framework for building web user interfaces and single page applications (SPAs).

How do I run a Vue JS code?

With your project open in Visual Studio Code hit the keyboard shortcut (cmd/ctrl) + `. The backtick is located right above the tab key on your keyboard. This will open the integrated terminal and from there you can run any script for your project.

Can I use Vue JS without node?

Vue is the front-end framework, node's server language. The two can be used in combination. But not vue must rely on node to use. The two of them can be perfect to achieve the front and back separation of the development model.

Why am I getting “you need to enable JavaScript to run” error?

If you're not having any problems when running your React app in the development server, but you see the You need to enable Javascript to run this app error when you run production build. You probably need to set up a server to serve your React app correctly. We have an in-depth guide covering this topic.

What does “please enable JavaScript to continue” mean?

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.

What is the use of the “Noscript” tag?

The "noscript" tag defines an alternate content to be displayed to users that have disabled scripts in their browser or have a browser that doesn't support script. The "noscript" element can be used in both "head" and "body" tag. When used inside "head", the "noscript" element could only contain "link", "style", and "meta" elements.

Does basicapp work without JavaScript enabled?

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.


4 Answers

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.

like image 147
Manoj Verma Avatar answered Oct 21 '22 03:10

Manoj Verma


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

like image 23
chao zhang Avatar answered Oct 21 '22 02:10

chao zhang


You need to disable the adblocker or run on incognito mode

like image 4
fatih celik Avatar answered Oct 21 '22 01:10

fatih celik


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...
}
like image 1
C.Christensen Avatar answered Oct 21 '22 03:10

C.Christensen