Skip to content

A Strange Syntax Error #321

Open
Open
@zejunking

Description

@zejunking

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.<anonymous> (D:/xxxxx/xxxxx/node_modules/taskr/lib/cli/spawn.js:35:9)
    at Generator.next (<anonymous>)
    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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions