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

Issue with spread operator in client.js #74

Closed
Lizard-King101 opened this issue Oct 31, 2019 · 4 comments
Closed

Issue with spread operator in client.js #74

Lizard-King101 opened this issue Oct 31, 2019 · 4 comments

Comments

@Lizard-King101
Copy link

using type script the spread operator is not recognized as an operator thus creating this error

[14:54:37]  ionic-app-script task: "build"
[14:54:37]  Error: ./node_modules/discord-rpc/src/client.js Module parse failed: Unexpected token (637:8) You may need
            an appropriate loader to handle this file type. | return this.request(RPCCommands.GET_RELATIONSHIPS) |
            .then((o) => o.relationships.map((r) => ({ | ...r, | type: types[r.type], | }))); @
            ./node_modules/discord-rpc/src/index.js 6:10-29 @ ./src/providers/discord.ts @ ./src/app/app.module.ts @
            ./src/app/main.ts
Error: ./node_modules/discord-rpc/src/client.js
Module parse failed: Unexpected token (637:8)
You may need an appropriate loader to handle this file type.
|     return this.request(RPCCommands.GET_RELATIONSHIPS)
|       .then((o) => o.relationships.map((r) => ({
|         ...r,
|         type: types[r.type],
|       })));
 @ ./node_modules/discord-rpc/src/index.js 6:10-29
 @ ./src/providers/discord.ts
 @ ./src/app/app.module.ts
 @ ./src/app/main.ts
    at new BuildError (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at callback (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/@ionic/app-scripts/dist/webpack.js:121:28)
    at emitRecords.err (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/webpack/lib/Compiler.js:265:13)
    at Compiler.emitRecords (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/webpack/lib/Compiler.js:371:38)
    at emitAssets.err (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/webpack/lib/Compiler.js:258:10)
    at applyPluginsAsyncSeries1.err (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/webpack/lib/Compiler.js:364:12)
    at next (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/nicklabrecque/Documents/apps/Seige-Craft/node_modules/webpack/lib/Compiler.js:361:9)

update the getRelationships function to

getRelationships() {
    const types = Object.keys(RelationshipTypes);
    return this.request(RPCCommands.GET_RELATIONSHIPS)
      .then((o) => o.relationships.map((r) => Object.assign({}, r, {type: types[r.type]})));
  }
@devsnek
Copy link
Member

devsnek commented Oct 31, 2019

you should upgrade your tooling

@devsnek devsnek closed this as completed Oct 31, 2019
@Lizard-King101
Copy link
Author

Lizard-King101 commented Oct 31, 2019

you should make things more compatible. you don't know what my project is, you don't know my limitations. Its not like I just came on here and gave you big long log for you to figure out on your own, NO, I took the time to figure out what was causing the error FIXED IT and let you know about it. . . Update my tooling smh

@Lizard-King101 Lizard-King101 changed the title Issue with spread operator in client.js NOT SOLVED Issue with spread operator in client.js Oct 31, 2019
@devsnek
Copy link
Member

devsnek commented Oct 31, 2019

I only maintain this library for the current node LTS. I'm sorry if you're using something older, but that's not supported by this library.

@Lizard-King101
Copy link
Author

wow . . . just wow so you cant turn {...r, type: types[r.type]} into Object.assign({}, r, {type: types[r.type]})

@discordjs discordjs deleted a comment from tipakA Oct 31, 2019
@discordjs discordjs locked as too heated and limited conversation to collaborators Oct 31, 2019
@iCrawl iCrawl changed the title NOT SOLVED Issue with spread operator in client.js Issue with spread operator in client.js Oct 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants