Error: regeneratorRuntime is not defined
See original GitHub issueCode
import ImapClient from 'emailjs-imap-client'
const options = {
auth: {
user: '<removed>',
pass: '<removed>'
}
}
const client = new ImapClient('imap.gmail.com', 993, options)
client.onerror = error => {
console.log('Email client error:', error)
}
console.log('Connecting...')
client.connect().then(() => {
console.log('Client connected!')
console.log('Closing connection...')
client.close().then(() => console.log('Connection closed'))
})
Expected result
Fairly straight forward. a few logs: client open, client closed. Just to test my connection to gmail.
Actual result
An error is thrown from the constructor, not from the client.onerror
handler.
$ node .
E:\Documents\GitHub\Repositories\temp\node_modules\emailjs-imap-client\dist\imap.js:500
value: /*#__PURE__*/regeneratorRuntime.mark(function _iterateIncomingBuffer() {
^
ReferenceError: regeneratorRuntime is not defined
at E:\Documents\GitHub\Repositories\temp\node_modules\emailjs-imap-client\dist\imap.js:500:25
at Object.<anonymous> (E:\Documents\GitHub\Repositories\temp\node_modules\emailjs-imap-client\dist\imap.js:1065:2)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (E:\Documents\GitHub\Repositories\temp\node_modules\emailjs-imap-client\dist\client.js:24:13)
Indeed, in the file that the error points to:
The variable regeneratorRuntime
isn’t defined anywhere that I can see, at least in that file.
I tried:
- Running in node (where
import
was swapped withrequire
) - Running in a browser (after building with parceljs).
So, what am I doing wrong here? I don’t see any other issues that mention this error so I must be doing something really silly…
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to fix regeneratorRuntime is not defined?
I have ran into a problem, the error is regeneratorRuntime is not defined while working with React and Parcel bundler.
Read more >Babel 6 regeneratorRuntime is not defined - Stack Overflow
This error is caused when async/await functions are used without the proper Babel plugins. As of March ...
Read more >ReferenceError regeneratorRuntime is not defined · Issue #9849
I'm building an SSR template, and when I use @babebl/register and then execute webpack (config), the system reported an error.
Read more >Parcel, how to fix the `regeneratorRuntime is not defined` error
I run into this problem in a project using Babel as soon as I added an async function, but the problem is the...
Read more >Blank Admin Page: regeneratorRuntime is not defined (babel?)
I've been trying to fix this because there is a lot of topic regarding this problem for babel but… I couldn't reach that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hi y’all, let me dive into the babel configuration later this weekend. didn’t have time to respond this week, sorry.
The self-signed warning is b/c you didn’t bother to get a proper TLS cert 😃 Interesting though that the warning doesn’t go through the error handler. Need to look into that. Check the tcp-socket repo to generate a proper self-signed cert. For testing purposes, add that cert to your certificate store. Never skip TLS verification in your production code. If you actually run that somewhere, please set up Let’s Encrypt.