Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.

Build issue: SyntaxError: Identifier 'tasks' has already been declared #1076

Closed
RoshanMali opened this issue Apr 22, 2021 · 8 comments · May be fixed by #1084
Closed

Build issue: SyntaxError: Identifier 'tasks' has already been declared #1076

RoshanMali opened this issue Apr 22, 2021 · 8 comments · May be fixed by #1084

Comments

@RoshanMali
Copy link

RoshanMali commented Apr 22, 2021

Found an issue or bug with electron-vue? Tell me all about it!

Describe the issue / bug.

Thank you for creating this package.

I'm facing this issue while building:

const tasks = new Listr(
        ^

SyntaxError: Identifier 'tasks' has already been declared
    at wrapSafe (internal/modules/cjs/loader.js:931:16)
    at Module._compile (internal/modules/cjs/loader.js:979:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

on .electron-vue\build.js:45

How can I reproduce this problem?
  1. Create new project using this command: vue init simulatedgreg/electron-vue my-project
  2. run: npm run build
If visual, provide a screenshot.

image

Tell me about your development environment.
  • Node version: v12.19.0
  • NPM version: 6.14.8
  • vue-cli version: 4.5.8
  • Operating System: Windows
@itenl
Copy link

itenl commented Apr 25, 2021

Same issues, but u can comment the code to working, btw, it is recommended that u use electron-builder.

@huaeval
Copy link

huaeval commented Apr 26, 2021

rename tasks

@oldsweet
Copy link

Same issues,can someone can help me? QwQ

@doc-han
Copy link

doc-han commented May 3, 2021

This is an actual error in the code. Tasks has been defined multiple times.

doc-han added a commit to doc-han/electron-vue that referenced this issue May 3, 2021
Changing the name of the predefined const tasks to prevent error in issue SimulatedGREG#1076
@phelogges
Copy link

i got this issue solved by commenting tasks and Multispinner instance, then upgrading electron-builder to the latest version.

Ohmry added a commit to Ohmry/electron-vue that referenced this issue May 16, 2021
…e electron-builder version to 22.10.5 3) uncomment app.use(hotMiddleware) fixed SimulatedGREG#1078
@eliooses
Copy link

Thanks for the workaround @phelogges !, works like a charm.

@RoshanMali
Copy link
Author

@phelogges solution worked, Thanks.

@583
Copy link

583 commented Dec 7, 2021

I solved this issue by rename the follow code.
line 45 => " const tasks" to " const _tasks"
line 77 => " await tasks " to " await _tasks"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants