elevatebart / vue-cli-plugin-template-loader

A plugin to run the vue-template-loader from @ktsn in the vue-cli
MIT License
4 stars 2 forks source link

Bug on install - delete src directory #2

Open Jeremy-F opened 5 years ago

Jeremy-F commented 5 years ago

Versions :

Result of : vue add template-loader

📦  Installing vue-cli-plugin-template-loader...

+ vue-cli-plugin-template-loader@1.0.0
updated 1 package and audited 15260 packages in 10.81s
found 0 vulnerabilities

✔  Successfully installed plugin: vue-cli-plugin-template-loader

🚀  Invoking generator for vue-cli-plugin-template-loader...
 ERROR  Error: Cannot find module '@vue/cli-plugin-typescript/generator/template/src/shims.d.ts' from '/private/tmp/test/node_modules/vue-cli-plugin-template-loader/generator/template/src'
Error: Cannot find module '@vue/cli-plugin-typescript/generator/template/src/shims.d.ts' from '/private/tmp/test/node_modules/vue-cli-plugin-template-loader/generator/template/src'
    at Function.module.exports [as sync] (/Users/ME?/.config/yarn/global/node_modules/resolve/lib/sync.js:43:15)
    at renderFile (/Users/ME?/.config/yarn/global/node_modules/@vue/cli/lib/GeneratorAPI.js:322:17)
    at _injectFileMiddleware (/Users/ME?/.config/yarn/global/node_modules/@vue/cli/lib/GeneratorAPI.js:184:27)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

And all my src directory has been deleted.

elevatebart commented 5 years ago

Ouch !! Yes, I entirely forget to update this plugin after the release of vue cli 3.1. I really think I should act on it soon. Can you give me until Saturday that I look into it. Sorry about your src folder, I hope it’s not too bad.

Jeremy-F commented 5 years ago

Don't worry, I solved the problem doing all the configuration manually. (Updating the vue.config.js, and adding a html.d.ts into my project, already using vue-template-loader).

My last commit solved the problem about my src folder, thanks 👍

m4ss1m0g commented 4 years ago

The bug is still unsolved, warning Installing this version erase the src folder

elevatebart commented 4 years ago

Hello @m4ss1mog,

I would like to try and fix this bug asap. Would you mind setting up a repo where it is failing?

Thank you in advance

m4ss1m0g commented 4 years ago

System

Repro step

  1. vue create -d -n repro
  2. cd repro\src
  3. touch newcomponent.vue
  4. cd .. Launch the next command on root directory
  5. vue add template-loader

Output

� Invoking generator for vue-cli-plugin-template-loader... ERROR Error: Cannot find module '@vue/cli-plugin-typescript/generator/template/src/shims.d.ts' from 'D:\temp\repro\node_modules\vue-cli-plugin-template-loader\generator\template\src' Error: Cannot find module '@vue/cli-plugin-typescript/generator/template/src/shims.d.ts' from 'D:\temp\repro\node_modules\vue-cli-plugin-template-loader\generator\template\src' at Function.resolveSync [as sync] (C:\Users\massimo\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\resolve\lib\sync.js:81:15) at renderFile (C:\Users\massimo\AppData\Roaming\npm\node_modules\@vue\cli\lib\GeneratorAPI.js:440:17) at _injectFileMiddleware (C:\Users\massimo\AppData\Roaming\npm\node_modules\@vue\cli\lib\GeneratorAPI.js:246:27) at process._tickCallback (internal/process/next_tick.js:68:7)

Result

The src folder is erased

elevatebart commented 4 years ago

I should probably check that vue/cli-plugin-typescript is already installed before I start invoking the plugin. That is a big bug indeed.

Regarding the empty src folder, what would you expect an empty newcomponent.vue to transform into? What should I put in the resulting js, css and html files?

m4ss1m0g commented 4 years ago

Regarding the empty src folder, what would you expect an empty newcomponent.vue to transform into? What should I put in the resulting js, css and html files?

In this case is only a placeholder to show you that installing the plugin delete the src folder, nothing more.

elevatebart commented 4 years ago

This issue should be fixed in v1.0.1