JS callout: Compilation error: generated bytecode for method exceeds 64K limit

fechen
New Member

Hi, I have my js callout policy as below. However, when deploy, it failed with compilation error:

Compilation of JavaScript jsc://tracing-init.js failed with error:Compilation error: Encountered code generation error while compiling script: generated bytecode for method exceeds 64K limit. (tracing_init#1).

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Javascript async="false" continueOnError="false" enabled="true" timeLimit="200" name="tracing-init">
    <DisplayName>tracing-init</DisplayName>
    <Properties/>
    <ResourceURL>jsc://tracing-init.js</ResourceURL>
    
    <IncludeURL>jsc://opentracing-browser.min.js</IncludeURL>
    <IncludeURL>jsc://lightstep-tracer.js</IncludeURL>
</Javascript>
0 3 656
3 REPLIES 3

Yes. Don't do that.

That's too much code to be including into a JS callout.

It's a limitation of the Apigee Edge product.

Thanks for your reply. But I have to use those two js libraries for my purpose. Do you have idea any alternative way I can do? Thanks!

I don't understand the opentracing or lightstep things. I have only a vague understanding of these things. If I were doing this I might build a facade or relay in a nodejs system, and host that remotely (in App Engine for example) and then use a ServiceCallout from the Apigee Proxy to call into that.

A second option I might explore if I were you: remove the opentracing and lightstep client libraries and just invoke the endpoints directly. From what I read these modules are "wrappers" around an API. I don't understand why the "wrapper" would be 64k, but i might explore reducing that to eliminate all the stuff I don't need.