Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token #580

Closed
cailven opened this issue Jun 26, 2018 · 3 comments
Closed

Unexpected token #580

cailven opened this issue Jun 26, 2018 · 3 comments

Comments

@cailven
Copy link

cailven commented Jun 26, 2018

"C:\Program Files\JetBrains\WebStorm 2018.1.5\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" D:\xampp\htdocs\node_modules\gulp\bin\gulp.js --color --gulpfile D:\xampp\htdocs\skechers\web\gulpfile.js default
[20:28:06] Using gulpfile D:\xampp\htdocs\skechers\web\gulpfile.js
[20:28:06] Starting 'default'...
D:/xampp/htdocs/node_modules/@types/acorn/index.d.ts(240,8): error TS2693: 'Symbol' only refers to a type, but is being used as a value here.
D:/xampp/htdocs/node_modules/@types/acorn/index.d.ts(240,28): error TS2304: Cannot find name 'Iterator'.
(node:20248) UnhandledPromiseRejectionWarning: Error: TypeScript: Compilation failed
at Output.mightFinish (D:\xampp\htdocs\node_modules\gulp-typescript\release\output.js:130:43)
at applySourceMap.then.appliedSourceMap (D:\xampp\htdocs\node_modules\gulp-typescript\release\output.js:43:22)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:20248) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:20248) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
TypeScript: 2 semantic errors
TypeScript: emit succeeded (with errors)

Process finished with exit code 0
111

@ivogabe
Copy link
Owner

ivogabe commented Jun 26, 2018

Which versions of TypeScript, gulp-typescript and Node are you using? And can you share your gulpfile?

@cailven
Copy link
Author

cailven commented Jun 27, 2018

typescript Version 2.9.2
gulp-typescript:5.0.0-alpha.2
nodejs:v 8.11.3

gulpfile.js:

var gulp = require('gulp');
var ts = require('gulp-typescript');

gulp.task('default', function () {
return gulp.src('src/*.ts')
.pipe(ts({
noImplicitAny: true,
outFile: 'output.js'
}))
.pipe(gulp.dest('built/local'));
});

@ivogabe
Copy link
Owner

ivogabe commented Sep 11, 2018

Looks like you need to set a newer lib file, as the Acorn typings require Symbol and Iterator. Could you try the following:

gulp.task('default', function () {
  return gulp.src('src/*.ts')
    .pipe(ts({
      noImplicitAny: true,
      outFile: 'output.js',
      lib: ["es2015", "dom"]
    }))
    .pipe(gulp.dest('built/local'));
});

@ivogabe ivogabe closed this as completed Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants