electron-userland / electron-forge-templates

Templates bundled with Electron Forge <= 5 to create Electron apps using popular JavaScript frameworks
107 stars 23 forks source link

Cannot find module 'vueify/lib/insert-css' #26

Closed IT-MikeS closed 5 years ago

IT-MikeS commented 7 years ago

This error will come up in the VueJs template, simple fix/workaround for me was to add Vueify as a dependency to the project via yarn/npm. Perhaps it would be worth including it in the templates package.json

malept commented 7 years ago

When does this happen? Running the following worked for me:

electron-forge init --template vue testvue
cd testvue
electron-forge start
IT-MikeS commented 7 years ago

In the below .vue if you change the default one created with electron-forge to that, it will throw the error in the BrowserWindow console ( Cannot find module 'vueify/lib/insert-css' ), or at least it does for me every time I tested it with a new project.

<template>
  <div>
    <h2 v-bind:class="{greenText: isGreenText}">Hello from test!</h2>
  </div>
</template>

<script type="text/babel">

  export default {
    name: 'test',

    data () {
      return {
        isGreenText: false,
      }
    },

    mounted: function(){
      this.testerCss();
    },

    methods: {

      testerCss: function(){
        console.log('Called');
        this.isGreenText = true;
      }

    }

  }
</script>

<style lang="scss" scoped>

  .greenText{
    color: #1ead27;
  }

</style>
malept commented 7 years ago

Since I don't know the Vue ecosystem very well, how common is it for someone to inline a style tag in a template, as opposed to in an external file (which I would assume doesn't use that insert-css module)?

I ask because the templates in this repo are supposed to be the minimal amount of code/dependencies for someone to get going with a given framework.

IT-MikeS commented 7 years ago

I cant say for certain how common it is but it's normally considered a better practice to use .vue files for each component which insert-css is needed for, now this should be taken with a grain of salt as I am for sure not the person who knows everything about VueJS and its ecosystem

anaisbetts commented 7 years ago

This is on my list, Vue support in electron-compile kind of sucks right now. The authors aren't super conducive to making their software work with anything other than Webpack tbh

luxalpa commented 6 years ago

This is actually a huge issue. Where's the problem in just adding vueify into the package.json?

michaelsogos commented 6 years ago

Dear Guys,

Any news about this?

vintprox commented 6 years ago

This one is related: https://github.com/electron-userland/electron-compile/issues/192

I actually don't like the way vueify is included in electron-compilers's package.json: it's bound to one user, which looks like a fork of the actual vueify. Unfortunately, it's not being installed automatically! Workaround:

npm install vueify --save
malept commented 5 years ago

Closing, see https://github.com/electron-userland/electron-forge-templates/issues/66