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.

_tls2.default.connect is not a function

See original GitHub issue

I’m trying to use this in my angular+electron app and getting this error:

[DEBUG][2018-02-09T16:53:31.517Z][1][igoventura@outlook.com][imap-mail.outlook.com] Connecting to imap-mail.outlook.com : 993 polyfills.bundle.js:3186 [DEBUG][2018-02-09T16:53:31.521Z][1][igoventura@outlook.com][imap-mail.outlook.com] Entering state: 1 polyfills.bundle.js:3186 [ERROR][2018-02-09T16:53:31.534Z][1][igoventura@outlook.com][imap-mail.outlook.com] Could not connect to server TypeError: _tls2.default.connect is not a function webpackJsonp../node_modules/zone.js/dist/zone-mix.js.ZoneDelegate.invoke @ polyfills.bundle.js:3186 webpackJsonp../node_modules/zone.js/dist/zone-mix.js.Zone.run @ polyfills.bundle.js:2936 console.(anonymous function) @ polyfills.bundle.js:5867 log @ vendor.bundle.js:98237 error @ vendor.bundle.js:98245 error @ vendor.bundle.js:96366 (anonymous) @ vendor.bundle.js:95481 step @ vendor.bundle.js:95368 (anonymous) @ vendor.bundle.js:95368 webpackJsonp../node_modules/zone.js/dist/zone-mix.js.ZoneDelegate.invoke @ polyfills.bundle.js:3186 onInvoke @ vendor.bundle.js:49849 webpackJsonp../node_modules/zone.js/dist/zone-mix.js.ZoneDelegate.invoke @ polyfills.bundle.js:3185 webpackJsonp../node_modules/zone.js/dist/zone-mix.js.Zone.run @ polyfills.bundle.js:2936 (anonymous) @ polyfills.bundle.js:3638 webpackJsonp../node_modules/zone.js/dist/zone-mix.js.ZoneDelegate.invokeTask @ polyfills.bundle.js:3219 onInvokeTask @ vendor.bundle.js:49840 webpackJsonp../node_modules/zone.js/dist/zone-mix.js.ZoneDelegate.invokeTask @ polyfills.bundle.js:3218 webpackJsonp../node_modules/zone.js/dist/zone-mix.js.Zone.runTask @ polyfills.bundle.js:2986 drainMicroTaskQueue @ polyfills.bundle.js:3396 polyfills.bundle.js:3186 [DEBUG][2018-02-09T16:53:31.536Z][1][igoventura@outlook.com][imap-mail.outlook.com] Entering state: 5 polyfills.bundle.js:3186 [DEBUG][2018-02-09T16:53:31.537Z][1][igoventura@outlook.com][imap-mail.outlook.com] Closing connection... polyfills.bundle.js:5864 ERROR Error: Uncaught (in promise): TypeError: _tls2.default.connect is not a function TypeError: _tls2.default.connect is not a function at new TCPSocket (vendor.bundle.js:100809) at Function.open (vendor.bundle.js:100785) at Promise (vendor.bundle.js:97414) at new ZoneAwarePromise (polyfills.bundle.js:3655) at Imap.connect (vendor.bundle.js:97413) at Promise (vendor.bundle.js:95493) at new ZoneAwarePromise (polyfills.bundle.js:3655) at Client._openConnection (vendor.bundle.js:95489) at vendor.bundle.js:95466 at Generator.next (<anonymous>) at new TCPSocket (vendor.bundle.js:100809) at Function.open (vendor.bundle.js:100785) at Promise (vendor.bundle.js:97414) at new ZoneAwarePromise (polyfills.bundle.js:3655) at Imap.connect (vendor.bundle.js:97413) at Promise (vendor.bundle.js:95493) at new ZoneAwarePromise (polyfills.bundle.js:3655) at Client._openConnection (vendor.bundle.js:95489) at vendor.bundle.js:95466 at Generator.next (<anonymous>) at resolvePromise (polyfills.bundle.js:3589) at resolvePromise (polyfills.bundle.js:3560) at polyfills.bundle.js:3638 at ZoneDelegate.webpackJsonp../node_modules/zone.js/dist/zone-mix.js.ZoneDelegate.invokeTask (polyfills.bundle.js:3219) at Object.onInvokeTask (vendor.bundle.js:49840) at ZoneDelegate.webpackJsonp../node_modules/zone.js/dist/zone-mix.js.ZoneDelegate.invokeTask (polyfills.bundle.js:3218) at Zone.webpackJsonp../node_modules/zone.js/dist/zone-mix.js.Zone.runTask (polyfills.bundle.js:2986) at drainMicroTaskQueue (polyfills.bundle.js:3396) at <anonymous>

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:24 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
thomas-topway-itcommented, Aug 9, 2020

hello, I have installed the library on a vue.js app and I get the same error. I’m just importing the library from a component using import ImapClient from 'emailjs-imap-client' and then after initializing the client using var client = new ImapClient(.... I get the error

TypeError: _tls2.default.connect is not a function
    at new TCPSocket

How can I solve it ? thanks (Thomas)

1reaction
felixhammerlcommented, May 16, 2018

damn. i will look into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tls.connect is not a function · Issue #216 · eleith/emailjs - GitHub
when I put email.server.connect({...}) into variable it shows error "tls.connect is not a function", but when I just console log it - no...
Read more >
TypeError: tls.connect is not a function - node.js - Stack Overflow
I keep getting this issue tls.connect is not a function. I am using nodemailer with my Reactjs and Nextjs application.
Read more >
TLS 1.2 enforcement for Azure AD Connect - Microsoft Learn
Learn how to force your Azure AD Connect server to use only Transport Layer Security (TLS) 1.2.
Read more >
TLS 1.2 and .NET Support: How to Avoid Connection Errors
When trying to connect to the API endpoint, I received the following error ... TLS 1.2 is supported, but it's not a default...
Read more >
How to Enable TLS 1.2 and TLS 1.3 on Windows Server
1. Open 'Run', type 'regedit' and click 'OK'. 2. In Registry Editor, navigate to the path : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols Create a new key by ......
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