Static GitHub Issues

[2310] Putting a .ts file in middleware/ leads to death

prev: [feature request] Ignore files with a prefix in all filesystem APIs
next: Middleware redirect infinity loop & Vuex Data not updating

nuxt version: 1.0.0-gh-704e7cd If you put a .ts file in middleware/ while nuxt dev is running, everything is fine. Furthermore, this file is actually compiled as typescript and can be required on pages through the middleware property.

However, if you stop the process and try to run nuxt dev again, you will get the most peculiar error: (only) page-level components (only) with <script lang="ts"> will produce the following error:

  ERROR  Failed to compile with 1 error

 error  in ./pages/check.vueerror  in ./pages/test.vue

Module build failed: Error: Could not find file: '/test/pages/test.vue'.
    at getValidSourceFile (/test/nod
e_modules/typescript/lib/typescript.js:95642:23)

This happens for any .ts file in middleware and any <script lang="ts"> in a page, even if the middleware is empty and unused and the script tag is empty.

<!--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/c2017">#c2017</a>)</em></sub></div>