vue-cli: We're sorry but work doesn't work properly without JavaScript enabled.

Version

4.3.1

Environment info

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

Steps to reproduce

I created a VueJS app and I’m getting the following error when I look at the source code in the web browse

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

What is expected?

Vue running smoothly

What is actually happening?

Nothing

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 11
  • Comments: 16 (1 by maintainers)

Most upvoted comments

my problem solved by replacing vue instantiation code in main.js with the following :

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app');

one of my colleagues did this i don’t know from where.

It’s expected. The Preview panel will try to render HTML but it does not run JavaScript so it only shows the content of the <noscript> tag.

The full source code is shown in the Response tab.

my problem solved by replacing vue instantiation code in main.js with the following :

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app');

one of my colleagues did this i don’t know from where.

If this method doesn’t work for you, try adding the following to the vue.config.js file:

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  ...
  publicPath: './',
  outputDir:'dist',
  assetsDir:'static'
})

i also have this problem when building for production , blank page with this error in response tab .

I change “history” to “hash” in the router mode, then the bug is resolved