question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when importing into a electron-vue app

See original GitHub issue

Hi,

I’m trying to use VueWorker in an app created with electron-vue, [https://github.com/SimulatedGREG/electron-vue].

When importing VueWorker, I get the following error, Uncaught SyntaxError: Unexpected token import at createScript (vm.js:74) at Object.runInThisContext (vm.js:116) at Module._compile (module.js:533) at Object.Module._extensions..js (module.js:580) at Module.load (module.js:503) at tryModuleLoad (module.js:466) at Function.Module._load (module.js:458) at Module.require (module.js:513) at require (internal/module.js:11) at eval (external "vue-worker"?b6d5:1)

I don’t know if this is a problem with electron-vue or with VueWorker, thought I’ll ask here first. The error is reported in \node_modules\vue-worker\index.js:1.

Steps:

Create an empty project with vue init simulatedgreg/electron-vue my-project

Then npm install vue-worker and import it in the main.js created by electron-vue.

As soon as you start the application, you’ll see the error.

Any ideas ?

Thanks.

I posted an issue on electron-vue as well, SimulatedGREG/electron-vue/issues/562

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
SpotlightPLcommented, Mar 5, 2019

@devszr you can simply whitelist vue-worker inside rendered config. https://github.com/SimulatedGREG/electron-vue/issues/284

0reactions
gsongsongcommented, Dec 28, 2018

@devszr Sad. I adopted suggestion described in https://stackoverflow.com/a/40251412/3278063.

A worker window is hidden ({show: false}) and routed to #/worker, which renders page with just an empty template and <script></script>, the real part.

I am not sure this approach has limitations, but so far it looks goot to me. Bothersome part is on main process bridging two (or more) renderer processes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to import electron related files into Vue 3
I'm using Vue with Electron, and trying to access the app.quit() method ... However, anything Electron related seems to give me this error:...
Read more >
FAQs · electron-vue
Why can't I load my app in a web browser? How do I import jquery ? ... Check console, fix errors, then refresh...
Read more >
Building Desktop Apps With Electron And Vue
In this tutorial, Timi Omoyeni explains what you need to keep in mind when building a desktop application with Vue.js using the Vue...
Read more >
app | Electron
error string - A string with the error's localized description. Emitted during Handoff when an activity from a different device fails to be...
Read more >
Building a Desktop App with Electron and Vue.js - Buddy.Works
The Vue CLI will create a project in the electron-vue project, initialize a git repository and install the Vue CLI plugins and npm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found