-
Notifications
You must be signed in to change notification settings - Fork 218
cannot bundle with CDK/esbuild and use in AWS Lambda #168
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
Comments
Same problem here. Any quick fixes for this? |
Was a fix for this issue found? It seems like esbuild is shaking off the |
I just switched to https://github.com/JSONPath-Plus/JSONPath |
Hi ! It's shaked off because both files in the missing "include" folder are required dynamically (no static require / import from) :
This syntax forbids all usage of this library with a bundler (esbuild, webpack, nx, ...) that uses tree shaking... |
this dynamic import needs to be fixed it breaks a lot of things |
Would you mind to take a look on this issue and the proposed fix #172 @dchester? There are large players using your library as their dependency, I'm currently getting issues through contentful-export being dependent on this library. Maintaining open-source library aside from your daily job is probably huge hassle, maybe it would be worth to consider picking some of the helpful fellows from active PR openers as contributors with a merge rights? |
I just ran into this issue, and converted to jsonpath-plus. For my application, it was a drop-in replacement that does not suffer from this behavior. A coworker indicated that the esbuild "dynamic modules" plugin is now deprecated and presumably intrinsically supports dynamically loaded modules in newer versions (24.x as of now). So this may be fixed and therefore jsonpath might work, though did not investigate that approach. One thing to consider, jsonpath-plus is no longer actively maintained. That could present issues in the future. BTW, I am specifically using a JSON path to navigate to a child-object based on a root object from which the JSON path is derived. For me the issue was an AWS CDK deployment that uses esbuild under the hood. I received warnings during deployment about those dynamic loaded modules in jsonpath, then module-not-found errors once running in the Lambda in the cloud. |
Hey guys,
awesome library. Love it! But I can't use it in lambda packaged with
esbuild
without some hacking because of this:https://github.com/dchester/jsonpath/blob/master/lib/grammar.js#L102
It comes down to this in runtime:
There are no files other than nicely bundled
index.js
afteresbuild
Thanks!
The text was updated successfully, but these errors were encountered: