electron-userland / electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
1.01k stars 99 forks source link

Vue: Uncaught Error: Cannot find module 'vueify/lib/insert-css' #192

Open jakenvac opened 7 years ago

jakenvac commented 7 years ago

When using CSS (or other style languages) in .Vue files, the following error occurs: Uncaught Error: Cannot find module 'vueify/lib/insert-css'

This seems to be down to a partial implementation of Vue JS into electron-compile.

This may be caused by the fact that only the runtime component of Vue JS is included with electron-compile, rather than the standalone. See Runtime + Compiler vs. Runtime-only for more information about the different Vue versions.

Reproducing The easiest way to reproduce this error is using electron-forge with the command electron-forge init style-error-demo --template=vue and simply add <style>h2 { color: red; }</style> to the end of src/test.vue

This has been Produced on Windows 7, 10 & Fedora 25

anaisbetts commented 7 years ago

You need to include vueify as a dependency in your app, I can't think of any nice way to fix this afaik

jakenvac commented 7 years ago

Thanks I'll give this a go. It might be worth including this in the documentation - Are there any best practices/contribution guidelines for this repo as far as the readme goes?

Edit: Is it not already using vueify for the .vue file compilation?

squaretone commented 6 years ago

I can confirm the same issue.

Including vueify in my component did fix the issue.

squaretone commented 6 years ago

Also note that I had to move vueify from devDependencies to dependencies for the build.

jakenvac commented 6 years ago

Hopefully that change can be "boilerplated" for a fix, then. :)

vintprox commented 6 years ago

I don't exactly understand the cause. Just look at electron-compilers dependencies: there we have @paulcbetts/vueify@9.4.3. Packager might install this one automatically, but mine didn't. I use Yarn 1.7.0. Can somebody please reproduce this issue with npm installation (to find potential bugs in the installation process)?