cinqmarsmedia / Lazy-Chess-An-Indie-Chess-Puzzle-Game

An indie chess puzzle game with innovative mechanics, designed to help engage new players and self-conscious enthusiasts.
https://cinqmarsmedia.com/lazychess
GNU General Public License v3.0
22 stars 4 forks source link

Property 'db' does not exist on type 'HomePage'. #1

Closed Vitexus closed 3 years ago

Vitexus commented 3 years ago

Hi,

the current 666773dd0a78fd34b8a349259897611d419bfc51

fail for me after clone and ci:

vitex@exiv:~/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game$ npm ci
npm WARN prepare removing existing node_modules/ before installation

> fsevents@1.2.13 install /home/vitex/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game/node_modules/fsevents
> node install.js

Skipping 'fsevents' build as platform linux is not supported

> core-js@2.6.12 postinstall /home/vitex/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game/node_modules/ng2-chessboard/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> core-js@3.9.0 postinstall /home/vitex/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> electron@11.2.3 postinstall /home/vitex/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game/node_modules/electron
> node install.js

> uglifyjs-webpack-plugin@0.4.6 postinstall /home/vitex/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js

> node-sass@4.14.1 install /home/vitex/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/vitex/.npm/_cacache/node-sass/4.14.1/linux-x64-64_binding.node

> node-sass@4.14.1 postinstall /home/vitex/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game/node_modules/node-sass
> node scripts/build.js

Binary found at /home/vitex/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game/node_modules/node-sass/vendor/linux-x64-64/binding.node
Testing binary
Binary is fine

> lazychess@0.0.1 postinstall /home/vitex/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game
> npx patch-package

npx: nainstalováno 50 za 4.689s
patch-package 6.4.7
Applying patches...
@angular/fire@5.4.2 ✔
ng2-chessboard@1.0.3 ✔
added 1185 packages in 31.661s

Run:

vitex@exiv:~/Projects/Packaging/Games/Lazy-Chess-An-Indie-Chess-Puzzle-Game$ ionic serve
> ionic-app-scripts serve --address localhost --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] [14:39:07]  ionic-app-scripts 3.2.3 
[app-scripts] [14:39:07]  watch started ... 
[app-scripts] [14:39:07]  build dev started ... 
[app-scripts] [14:39:08]  clean started ... 
[app-scripts] [14:39:08]  clean finished in 4 ms 
[app-scripts] [14:39:08]  copy started ... 
[app-scripts] [14:39:09]  deeplinks started ... 
[app-scripts] [14:39:09]  deeplinks finished in 472 ms 
[app-scripts] [14:39:09]  transpile started ... 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 487 
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]      L486:    this._queueSub.unsubscribe();
[app-scripts]      L487:    this.db.list("/queue").remove();
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 1445 
[app-scripts]     L1444:  if (this._fbSubGame) {
[app-scripts]     L1445:    this.db.list(this.gameType).push("QUIT");
[app-scripts]     L1446:    //this.db.list(this.gameType).remove(); // delete
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 1968 
[app-scripts]     L1967:  handler: (data) => {
[app-scripts]     L1968:    this.db.list(this.gameType).remove();
[app-scripts]     L1969:    this._fbSubGame.unsubscribe();
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]     L2034:  // confirm game for player two
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2035 
[app-scripts]     L2035:  this.db.list(this.gameType).push("confirmed");
[app-scripts]     L2036:  this.whiteBottom = false;
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2172 
[app-scripts]     L2171:  if (wait) {
[app-scripts]     L2172:    this.db.list(this.gameType).push("wait");
[app-scripts]     L2173:  } else {
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]     L2184:      this._fbSubGame = this.db
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2184 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2222 
[app-scripts]     L2185:        .list(this.gameType)
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]     L2221:    this._queueSub.unsubscribe();
[app-scripts]     L2222:    this.db.list("/queue").remove();
[app-scripts]     L2223:  },
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2228 
[app-scripts]     L2228:      this._queueSub = this.db
[app-scripts]     L2229:        .list("/queue")
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2239 
[app-scripts]     L2238:    console.log("pushqueue");
[app-scripts]     L2239:    this.db.list("/queue").push([code, now]);
[app-scripts]     L2240:  } else if (data[0][0] !== code && data.length == 1) {
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]     L2244:    //120000// || data[0][0].includes(this.username) prevent matching with yourself
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2245 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2247 
[app-scripts]     L2245:    this.db.list("/queue").remove();
[app-scripts]     L2246:  } else {
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]     L2246:  } else {
[app-scripts]     L2247:    this.db.list("/queue").push("ok");
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2255 
[app-scripts]     L2254:  this._queueSub.unsubscribe();
[app-scripts]     L2255:  this.db.list("/queue").remove();
[app-scripts]     L2256:  //console.log("startinnnn");
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2268 
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]     L2267:  //this._queueSub.unsubscribe();
[app-scripts]     L2268:  this.db.list("/queue").remove();
[app-scripts]     L2269:  //console.log("AHHHHH");
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]     L2353:  if (!won && !draw) {
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2354 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2371 
[app-scripts]     L2354:    this.db.list(this.gameType).push("checkmated:" + myrank);
[app-scripts]     L2355:    console.log("I got checkmated");
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]     L2370:              handler: (data) => {
[app-scripts]     L2371:                this.db.list(this.gameType).push("NOREMATCH");
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2381 
[app-scripts]     L2380:  handler: (data) => {
[app-scripts]     L2381:    this.db.list(this.gameType).push("REMATCH");
[app-scripts]     L2382:    this.awaitingRematch = true;
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts]     L2390:  handler: (data) => {
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 2391 
[app-scripts]     L2391:    this.db.list(this.gameType).push("NOREMATCH");
[app-scripts]     L2392:    this._fbSubGame.unsubscribe();
[app-scripts]             Property 'db' does not exist on type 'HomePage'. 
[app-scripts] [14:39:17]  typescript: src/pages/home/home.ts, line: 3122 
[app-scripts]     L3122:        this.db.list(this.gameType).push(moveObj);

[INFO] Development server running!

       Local: http://localhost:8100

       Use Ctrl+C to quit this process

[INFO] Browser window opened to http://localhost:8100!

[app-scripts] [14:39:17]  copy finished in 9.04 s 
[app-scripts] [14:39:17]  watch ready in 9.50 s 

Cold you please tell me what is wrong ?

Thank you

ccj242 commented 3 years ago

Hey @Vitexus! this.db is the variable that interfaces with firebase. Since I removed firebase from the constructor because I wanted users to be able to run without generating their own credentials, this.db no longer exists. I've commented out references to it in home.ts in the latest push which should solve your problem, but if you want to integrate firebase and online functionality, you'll need to comment them in! Let me know if you have any other issues. Thanks!

Vitexus commented 3 years ago

Please add some option/switch for "offline" use. (or add this information into main README build section)

Until today was my life without such big thing as Firebase almost happy :)

Thank you for your game and time

ccj242 commented 3 years ago

This makes a lot of sense but off the top of my head, I'm not sure how it would be possible - since by importing the firebase dependency into the constructor with improper credentials crashes the game and I would have to modify the dependency manually to avoid this. To my knowledge there's no way to variably import something in a constructor? But I'll look into it. I'll add instructions in the ReadMe. Thanks!