question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught (in promise) TypeError: packs.flatMap is not a function

See original GitHub issue

大佬您好。 在electron-vue 项目中使用了 "bilibili-live-ws": "^5.1.1" node -v : v14.17.4 运行过程中提示:

Uncaught (in promise) TypeError: packs.flatMap is not a function
    at Object.exports.decoder (F:\git_pro\muamuamua\node_modules\bilibili-live-ws\src\buffer.js:51)

buffer.js:

return packs.flatMap(pack => {
        if (pack.protocol === 2) {
            return pack.data;
        }
        return pack;
    });

我改成:

packs.forEach(pack => {
        if (pack.protocol === 2) {
            pack = pack.data
        }
    });
    return packs

倒是可以。 不过最近在使用GitHub 的 actions就又出现了。 QAQ

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
simon300000commented, Mar 18, 2022

我得写进readme😭

1reaction
simon300000commented, Mar 18, 2022

😨😨😨😨😨😨😨😨😨

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: flatMap is not a function in JavaScript | bobbyhadz
To solve the "flatMap is not a function" error, make sure to only call the flatMap method on arrays and in browsers that...
Read more >
TypeError: xxx.flatMap is not a function - Stack Overflow
The variable dataset holds an object. You have to call flatMap on dataset.PFA.Entity . const body = dataset.PFA.Entity.
Read more >
Object.entries(...).flatMap is not a function - Support
The last time my deploy worked was on May 10th and here's the deploy link working: Last working deploy Since then I have...
Read more >
Node.js v19.3.0 Documentation
If asyncFn is a function and it throws an error synchronously, assert.doesNotReject() will return a rejected Promise with that error. If the function...
Read more >
cannot read properties of undefined (reading 'flatmap')
packages /client/components/Dashboard.tsx in c at line 88:32 ... main.bundle.js:1 Uncaught TypeError: Cannot read properties of undefined (reading '__H') at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found