vuejs / vue-loader

📦 Webpack loader for Vue.js components
MIT License
4.99k stars 915 forks source link

Build error inside vue-loader with babel/typescript #1935

Closed SteFlemmer closed 2 years ago

SteFlemmer commented 2 years ago

Version

16.8.3

Reproduction link

https://github.com/SteFlemmer/vue-typescript-test

Steps to reproduce

  1. Clone the minimal reproducible example git clone https://github.com/SteFlemmer/vue-typescript-test.
  2. Run npm run serve / npm run build.
  3. See Error during build of the Application:

ERROR in ./componentsVue/App.vue?vue&type=template&id=47901164&ts=true
Module parse failed: Unexpected token (3:27)
File was processed with these loaders:
 * ./node_modules/vue-loader/dist/templateLoader.js
 * ./node_modules/vue-loader/dist/index.js
You may need an additional loader to handle the result of these loaders.

What is expected?

Template Loader should not fail to load the vue template part, if it is treated as a .ts file

Versions

  1. @babel/core@7.15.0
  2. @babel/plugin-syntax-dynamic-import@7.8.3
  3. @babel/plugin-transform-runtime@7.15.0
  4. @babel/preset-env@7.15.0
  5. @babel/preset-typescript@7.16.0
  6. @typescript-eslint/eslint-plugin@5.3.1
  7. @typescript-eslint/parser@5.3.1
  8. babel-eslint@10.1.0
  9. babel-loader@8.1.0
  10. clean-webpack-plugin@0.1.19
  11. eslint@7.8.1
  12. eslint-loader@4.0.2
  13. eslint-plugin-vue@8.2.0
  14. fork-ts-checker-webpack-plugin@6.5.0
  15. html-webpack-plugin@4.5.2
  16. node-sass@6.0.0
  17. thread-loader@2.1.3
  18. typescript@4.4.4
  19. vue-loader@16.8.3
  20. webpack@4.36.0
  21. webpack-cli@3.1.0
  22. webpack-dev-server@3.11.3


vue-bot commented 2 years ago

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!