Closed nsunami closed 2 years ago
This is a note to self to check app/api/weekly-digest-mailer.ts
I'm seeing a weird error where I cannot call the API endpoint for quirrel.
Steps that I took:
http://localhost:3000/api/weekly-digest-mailer
on my browserTypeError: Cannot read properties of undefined (reading 'length')
at getLens (/Users/nami/git/ResearchEquals.com/node_modules/base64-js/index.js:23:17)
at Object.toByteArray (/Users/nami/git/ResearchEquals.com/node_modules/base64-js/index.js:55:14)
at unpackMessage (/Users/nami/git/ResearchEquals.com/node_modules/secure-e2ee/dist/base-encryptor.js:104:51)
at Encryptor.<anonymous> (/Users/nami/git/ResearchEquals.com/node_modules/secure-e2ee/dist/base-encryptor.js:156:30)
at step (/Users/nami/git/ResearchEquals.com/node_modules/secure-e2ee/dist/base-encryptor.js:75:23)
at Object.next (/Users/nami/git/ResearchEquals.com/node_modules/secure-e2ee/dist/base-encryptor.js:56:53)
at /Users/nami/git/ResearchEquals.com/node_modules/secure-e2ee/dist/base-encryptor.js:50:71
at new Promise (<anonymous>)
at __awaiter (/Users/nami/git/ResearchEquals.com/node_modules/secure-e2ee/dist/base-encryptor.js:46:12)
at BaseEncryptor.decrypt (/Users/nami/git/ResearchEquals.com/node_modules/secure-e2ee/dist/base-encryptor.js:151:16)
I think the error was coming from the fact that there were environment variables set (.env.local
&
.env.test.local
). When I removed the following environment variables, the job ran:
QUIRREL_TOKEN
QUIRREL_BASE_URL
QUIRREL_ENCRYPTION_SECRET
For what it's worth - you cannot activate the Quirrel jobs by accessing the endpoint on it's own (here through localhost:3000/api/weekly-digest-mailer
). That's not how quirrel works (that would be open to abuse upon deploy).
You need to go to your Quirrel deployment - defaults to http://127.0.0.1:9181
for local build.
You can manually invoke the methods here.
EDIT: Also made sure to note this in the Wiki.
URL of the Page
(email digest)
What happened?
In the email digest, published modules are still listed as drafts.
For example, the following module is listed as a draft in the digest email:
The URL of the link is: https://www.researchequals.com/drafts?suffix=qcwj-d1mp
But clicking it will lead to a blank page in the drafts tab.
In fact, the module with the suffix
qcwj-d1mp
is already published here: https://www.researchequals.com/modules/qcwj-d1mpSteps to reproduce
Open a digest email (the account must have a published module)
What browser(s) did you use?
Chrome
Anything else?
No response