lukeed / lukeed/taskr

A Strange Syntax Error

Open
#321 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.5k
Forks
72
PR merge metrics
No merged PRs in 30d

Description

Why?:
The Code will report a strange Syntax Error, but it will run normally after removing `const WORK_SPACE = process.cwd();`

Code:
```
const WORK_SPACE = process.cwd();

export async function test(task){
console.log(';test')
}

export default async function (task) {
console.log("index taskr");
await task.clear('compild');
await task.start('test');
}
```
ERROR:
```
export async function test(task){
^^^^^^
SyntaxError: Unexpected token 'export'
at new Taskr (D:/xxxxx/xxxxx/node_modules/taskr/lib/taskr.js:21:39)
at Object. (D:/xxxxx/xxxxx/node_modules/taskr/lib/cli/spawn.js:35:9)
at Generator.next ()
at Generator.tryCatcher (D:/xxxxx/xxxxx/node_modules/bluebird/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled (D:/xxxxx/xxxxx/node_modules/bluebird/js/release/generators.js:97:49)
```
ENV:
node 12.18.3
packages:
"@taskr/clear": "^1.1.0",
"@taskr/esnext": "^1.1.0",
"@taskr/watch": "^1.1.0",
"@vercel/ncc": "^0.27.0",
"node-notifier": "^9.0.0",
"taskr": "^1.1.0",
"typescript": "^4.1.3"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided snippet with Node 12.18.3 and the listed Taskr packages, then inspect node_modules/taskr/lib/taskr.js and lib/cli/spawn.js as shown in the stack trace. Done means the task file runs without the unexpected export syntax error while const WORK_SPACE = process.cwd(); remains present.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.