Static GitHub Issues

[2888] JS execution silently fails on a statically generated site

prev: sass source maps for independent sass files
next: How to import external component with external store

JS execution silently fails on a statically generated site when a route path contains non-ascii characters.

Steps to reproduce:

vue init nuxt-community/starter-template nuxt-project
cd nuxt-project
npm i
cp pages/index.vue pages/провизорам.vue
npm run generate
npm i http-server
npx http-server dist

Put some console.logs into провизорам.vue and index.vue, for example

<template>
  <div></div>
</template>

<script>
export default {
  mounted () {
    console.log('test')
  }
}
</script>

Visit http://localhost:8080/провизорам and you'll see that the console.log does not get executed and that there is no error in the developer console. But if you put some code into index.vue and visit http://localhost:8080/ the code will execute.

When running npm run dev this problem does not manifest itself.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2510">#c2510</a>)</em></sub></div>