luixaviles / socket-io-typescript-chat

A chat application implemented using Socket.io, TypeScript, Angular and Angular Material components

Home Page:https://medium.com/dailyjs/real-time-apps-with-typescript-integrating-web-sockets-node-angular-e2b57cbd1ec1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find name 'Symbol'

xinthose opened this issue · comments

C:\node_apps\socket-io-typescript-chat\server>gulp build
[11:31:37] Using gulpfile C:\node_apps\socket-io-typescript-chat\server\gulpfile
.js
[11:31:37] Starting 'build'...
Compiler option 'compileOnSave' requires a value of type boolean.
C:/node_apps/socket-io-typescript-chat/server/node_modules/@types/node/index.d.t
s(6903,88): error TS2304: Cannot find name 'Symbol'.
[11:31:39] TypeScript: 1 semantic error
[11:31:39] TypeScript: emit succeeded (with errors)
[11:31:39] Finished 'build' after 1.89 s

Have you fixed?

Same issue here.

gulp-cli@2.0.1
node --version
v11.4.0

Gulp still builds fine. I have not noticed any adverse effects from this error in the project.

For a temp fix I have edited from Library | Symbol thing which I don't remember now.
But I just removed it and it got compiled and working fine. issue is its not in ES6 format and outdated right now.

Same issue and one other:

/home/rootuser/Documents/angular/socket-io-typescript-chat/server/node_modules/@types/node/perf_hooks.d.ts(275,31): error TS2304: Cannot find name 'Map'.
/home/rootuser/Documents/angular/socket-io-typescript-chat/server/node_modules/@types/node/util.d.ts(117,88): error TS2304: Cannot find name 'Symbol'.

My current config:
node -v
v8.10.0
npm -v
3.5.2
gulp -v
CLI version 2.0.1
Local version 3.9.1

Just Change the Lib on tsconfig.json
Before :
{ "files": [ "src/*.ts", "src/model/*.ts" ], "compilerOptions": { "noImplicitAny": true, "target": "es5" } }

After :
{ "files": [ "src/*.ts", "src/model/*.ts" ], "compilerOptions": { "noImplicitAny": true, "target": "es5", "lib": ["es5", "es2015.symbol", "es2015.symbol.wellknown"] } }

i think this fixed the issue.

I am no longer noticing the issue:
package.json

  "dependencies": {
    "@types/cors": "^2.8.5",
    "@types/express": "~4.0.36",
    "@types/socket.io": "^1.4.40",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "gulp-cli": "^2.2.0",
    "nodemailer": "^5.1.1",
    "socket.io": "~2.0.3"
  },
  "devDependencies": {
    "gulp": "^4.0.2",
    "gulp-typescript": "^5.0.1",
    "typescript": "^2.9.2"
  }

tsconfig.json

{
  "compileOnSave": false,
  "files": [
    "src/eds-server.ts",
    "src/index.ts",
    "src/config.ts"
  ],
  "compilerOptions": {
    "lib": ["es5", "dom"],
    "target": "es5",
  }
}