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.

Bad sublibrary gets seen as "missing codegen plugin"

See original GitHub issue

https://github.com/dotansimha/graphql-code-generator/blob/e8bc671a0f4145e9a24436c86ab0d24f94e91725/packages/graphql-codegen-cli/src/plugins.ts#L21-L54

The above code isn’t a sufficient try-catch for what I just experienced. In my case, having freshly installed and inited everything I was encountering a message saying libraries that I did have installed weren’t installed, and I should try the list.

After digging with a debugger into the above lines I found that while pluginLoader() did return an error while looking for a plugin, it didn’t match the condition err.code !== 'MODULE_NOT_FOUND', which resulted in the above mentioned warning message logic.

However in reality, the error that was occurring was because an underlying library wasn’t the right version and had shipped with a bug! I never got to see this message because the catch is too strict.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

2reactions
krainboltgreenecommented, Sep 8, 2021

That is the exact thing I’m describing, thanks for bringing receipts!

1reaction
patrickocoffeyocommented, Sep 8, 2021

@krainboltgreene I recently ran into a similar issue using @graphql/codegen-typescript. The plugin loader was throwing an error with the code MODULE_NOT_FOUND, but when you do a little logging you can see that the real error is Error: Cannot find module '@babel/runtime/helpers/objectSpread2'. My temporary solution was to install @babel/runtime as a dev dependency, however if I get some time this week I’ll put together a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project with path '' could not be found in root project '' gradle ...
it used to say sublibrary could not be found in project my-plugin . Adding include ':sublibrary` project(':sublibrary').projectDir = new File(' ...
Read more >
Monthly Hask Anything (May 2021) : r/haskell - Reddit
This is your opportunity to ask any questions you feel don't deserve their own threads, no matter how small or simple they might...
Read more >
Making QEMU easier for management tools and applications
No idea how well Go or Rust bindings can work. This is something that bothered me for a while now. Even though it's...
Read more >
Embedded Coder™ User's Guide - Purdue Engineering
Example: Calling Reentrant Code with No Persistent or ... Troubleshooting “sched_setaffinity: Bad address” Error . . 34-19 ... Getting Started with RTDX ....
Read more >
Changelog for Cogl 1.11.2 - ABI laboratory
Added an optional libcogl-gles2 sub-library that provides a full GLES 2.0 api api ... Added the missing cogl_is_onscreen and cogl_is_framebuffer functions.
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