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

Failed to generate qrcode. Error: bad rs block #47

Open
vidz1979 opened this issue Nov 13, 2021 · 2 comments
Open

Failed to generate qrcode. Error: bad rs block #47

vidz1979 opened this issue Nov 13, 2021 · 2 comments

Comments

@vidz1979
Copy link

vidz1979 commented Nov 13, 2021

I am getting this error since I moved my project to Typescript (with CJS was working fine):

generate('1@myDUfOyRFgL650YXw7hqOIh97DiPfCTSWvL/lWY0xk5eMO1/RwU2BJQqyKwKCfy4YQ89jbcJpIs9pA==,y+0gkbGCtydkADbHaPz4BmDHh/Htmvck1+ZJzDANyHA=,39iJKFq9jMqBL3QPcKUY4w==')

Error: bad rs block @ typeNumber:1/errorCorrectLevel:undefined
at Function.QRRSBlock.getRSBlocks (/Users/junior/dev/bot-whatsapp/node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js:261:9)
at QRCode.make (/Users/junior/dev/bot-whatsapp/node_modules/qrcode-terminal/vendor/QRCode/index.js:58:30)
at generate (/Users/junior/dev/bot-whatsapp/node_modules/qrcode-terminal/lib/main.js:35:16)
at /Users/junior/dev/bot-whatsapp/src/main.ts:33:17
at step (/Users/junior/dev/bot-whatsapp/src/main.ts:52:23)
at Object.next (/Users/junior/dev/bot-whatsapp/src/main.ts:33:53)
at fulfilled (/Users/junior/dev/bot-whatsapp/src/main.ts:24:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

@wedreamer
Copy link

// import { generate } from "qrcode-terminal"; -> err
const qrcode = require('qrcode-terminal');

const qr = `1@DYZM9Y7+JBq1c+0TigkfeKUFj5y2bEJko/4MRz2EU3nQpGxdDgVYMqCwKdaXdzDsTKjbYkc8eswoSg==,kEkbz6rn1k3MvmZ+HhsHQusz6pgmWqzgWY55aZtM21o=,AqWACiDRD+oJ+Sq/72WXWQ==`

qrcode.generate(qr)

@jantimon
Copy link

This would be fixed by #49

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

3 participants