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 TypeErrror` in browser console after upgrading to 3.3.3

See original GitHub issue

After upgrading from 3.3.2 to 3.3.3 I started seeing error messages in the browser console on startup. The message is of the form Uncaught TypeError: f$1 is not a function.

One of the lines of code in the callstack is

hardExit$3.apply$mcVI$sp__I__V(c.Lcats_effect_ExitCode__f_code)

With the line above it is:

var c = $j_cats$002eeffect$002eExitCode.$as_Lcats_effect_ExitCode(c$2);
 hardExit$3.apply$mcVI$sp__I__V(c.Lcats_effect_ExitCode__f_code)

This looks similar to this line of code from #2707: https://github.com/typelevel/cats-effect/blob/614e98982602263d1447f3a9975be84bb4c23a67/core/js/src/main/scala/cats/effect/IOApp.scala#L243

I haven’t been able to verify it is the problem, but the cats effect upgrade is the only change. If needed, I could try to create a minimal example. The application it is occurring in does not qualify as simple…

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
toddburnsidecommented, Jan 5, 2022

I’m probably not going to get a chance to look at it tonight, but I’ll try to reproduce it in the morning.

0reactions
armanbilgecommented, Jan 6, 2022

@cquiroz yes, process is a tricky one. We mostly use it so that IOApp on Node.js can behave like the JVM: command line args, signal handlers, exit hooks, etc.

But, process.env specifically has become a sort of pseudo-standard across web frameworks as well:

Enough so, that we also use it for configuring the CE runtime on JS: https://typelevel.org/cats-effect/docs/scaling-and-tuning/io-runtime-config#js

So, we have to resort to js.Dynamic and Try when working with process, and rely on our test suite to make sure we didn’t forget any Try 😬

Maybe a more robust approach would be to first detect globally if we are running in Node.js, and then use that to decide whether or not to do all those Node.js-only process things. Then if we forget to wrap something in a Try like I did here it is much less likely to create a problem.

val isNodeJSRuntime = Try(
  js.Dynamic.global.process.release.name.asInstanceOf[String]
).toOption.exists(_ == "node")
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in console after upgrading jQuery to v.3.3.1 and jQueryUI
I'm running the following issue: After upgrading to latest jQuery version (3.3.1) and jQueryUI v.1.12.1. ... VM133:1 Uncaught TypeError: $(.
Read more >
[Panel] Panel backend silently broken with browser console ...
The above client-side JavaScript Uncaught TypeError: a.vtkns.OutlineFilter is undefined exception suggests badness within PyVista itself ...
Read more >
Uncaught TypeError: $(...).find(...).andSelf is not a function
Having just upgraded jQuery to version 3.4 I've just run into this issue. I've supplied a patch against drupal version 7.69 (hence the...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
All this means is that you are trying to access a property of an object that is undefined. These usually happens when we...
Read more >
jQuery DataTables: Common JavaScript console errors
TypeError : $(…).DataTable is not a function. Cause. jQuery DataTables library is missing. jQuery library is loaded after jQuery DataTables.
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