-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Getting "is not a function" error with node-library build, but only in specific situations/locations #849
Comments
Another thing to note is that it works fine with a release build of the cljs. I only see this error when running a watch on the build for development. |
Sorry I cannot tell what the code is doing. The location you linked doesn't seem to be anywhere close to the use of the Without a reproducible example I cannot help. |
I just meant if I've worked around the issue by exporting our cljs library from our utilities.ts module, where calls work well, and then in those trouble files where direct calls don't work (just a couple that I've noticed thus far), I import the cljs library from the utilities module and calling functions from that works (just not if I import the cljs lib directly and call the functions). It's some kind of weird linking issue it seems, but I'm guessing it's not anything caused by shadow. Closing this now. Thanks, though! |
This is what I meant by the utilities proxy thing above, that works, just fyi: https://github.com/BetterThanTomorrow/calva/blob/86151d702f844136082dc3c41d7e8c719f9869ea/src/namespace.ts#L47 |
Opening this back up and providing a repro, as it continues to give me trouble. I made a separate branch with a repro case: https://github.com/BetterThanTomorrow/calva/tree/cljs_issue_repro. The steps to be performed on that branch:
The above error is happening in this function, which is being called from here when you hover over a symbol. You can see this function is exported in our shadow config. It works in some cases, and not in others. And some of the other exported function calls have also thrown that error, whereas calls to those same functions in other locations work. I haven't found a pattern yet to hint at a cause. In the past I was getting this error during development, with not bundled output, but the bundled-with-webpack output worked. However, now it works in development, but the errors show up in the bundled output. So, from my perspective it's really strange, but I really hope the fix is something simple I'm just missing. 😄 |
Sorry but this is far too much code and setup required for me to look at. I have none of those tools installed and cannot simply run this. It looks fine config wise but I don't have a clue what is going on in the code. |
Ah, okay. Well, in any case thanks for all you've done with this project! I still have hope I can work more cljs into Calva. I'll keep working at it. |
Please remember that |
This is something I've been troubleshooting for a while now. As per our recent discussions I've stuck to the :node-library target for Calva. I'll try to explain this as simply as possible. I just want to see if you happen to know off hand what's going on.
I've found that calling functions exported from the shadow-cljs build does not work only in a particular place in our code base. For example, in this particular file/function, if we call
parseForms
, which is required from our cljs library, when Calva loads this call is executed and we get an error:cljs_lib_1.parseForms is not a function
.This call, however, works in other files/locations. I can move it up one level into the code that calls this
updateREPLSessionType
function, and it works. This is really strange to me.I may be able to refactor to work around it by just not calling the cljs library functions from that location, but I like to know why things aren't working, and it's a bit concerning that maybe this could pop up elsewhere.
The text was updated successfully, but these errors were encountered: