Skip to content

Resulting .jsc file not working in browser when using ES2017+ #66

Closed
@petef19

Description

@petef19

Hello,

we have an Electron/Angular app and use Bytenode to compile the resulting Angular .js file (used in the browser / renderer process) to .jsc (file is compiled via Electron).

Everything works fine when targeting ES2015 in Angular. If we change the target to ES2017 or newer the resulting .jsc file (that Bytenode creates from the Angular .js) does not work in the Electron app.

We confirmed this as a Bytenode issue by removing Bytenode from our built pipeline and testing the Angular ES2017 .js file directly in the Electron app, and that works just fine.

Is this a known limitation and/or are there any settings to circumvent this issue ?

I'm strongly assuming this has to do w/ async/await blocks (which we use quite a bit in the Ng app) similar to what has been reported in #47, but again Bytenode works fine for us w/ async arrow functions when targeting ES2015...

So is the async arrow function limitation only for ES2017 and higher ?

Electron tech stack:
Electron 8.4.0
Node 12.13.0 (used by Electron)
Chrome 80.0.3987.165

Error shown in Electron when enabling logging:

#
# Fatal error in , line 0
# ignored
#
#
#
#FailureMessage Object: 0000001BD17EC310Backtrace:
        uv_loadavg [0x00007FF7416C6B52+1217650]
        uv_loadavg [0x00007FF741657C12+763186]
        GetHandleVerifier [0x00007FF7421E5BB7+5088967]
        IsSandboxedProcess [0x00007FF741B51FF9+332137]
        v8::internal::OSROptimizedCodeCache::GetBailoutIdFromEntry [0x00007FF74071F71B+180891]
        v8::internal::OSROptimizedCodeCache::GetBailoutIdFromEntry [0x00007FF74071E7F8+177016]
        v8::internal::OSROptimizedCodeCache::GetBailoutIdFromEntry [0x00007FF740742800+324480]
        v8::EmbedderHeapTracer::IterateTracedGlobalHandles [0x00007FF7404526B1+606481]
        v8::Unwinder::PCIsInV8 [0x00007FF7404C4AE1+112897]
        v8::Unwinder::PCIsInV8 [0x00007FF7404C48D3+112371]
        v8::Unlocker::~Unlocker [0x00007FF7404F0355+147477]
        v8::internal::OSROptimizedCodeCache::GetBailoutIdFromEntry [0x00007FF7406FDE1C+43420]
        v8::internal::OSROptimizedCodeCache::GetBailoutIdFromEntry [0x00007FF7406FD8B4+42036]
        v8::internal::OSROptimizedCodeCache::GetBailoutIdFromEntry [0x00007FF7406FDC26+42918]
        v8::StackFrame::GetFunctionName [0x00007FF740396A8F+127]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740A1975E+526]
        v8_inspector::DumpAsyncTaskStacksStateForTest [0x00007FF740A01CE5+143957]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740A1A005+2741]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740A19CFA+1962]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740A1A454+3844]
        v8_inspector::DumpAsyncTaskStacksStateForTest [0x00007FF7409FE1CE+128830]
        v8_inspector::DumpAsyncTaskStacksStateForTest [0x00007FF7409E649A+31242]
        v8_inspector::DumpAsyncTaskStacksStateForTest [0x00007FF7409E42EB+22619]
        v8_inspector::DumpAsyncTaskStacksStateForTest [0x00007FF7409E4494+23044]
        v8::EmbedderHeapTracer::IterateTracedGlobalHandles [0x00007FF740408181+302049]
        v8::EmbedderHeapTracer::IterateTracedGlobalHandles [0x00007FF740403519+282489]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740CE93BD+2948717]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740CFC0F9+3025833]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C784D8+2486152]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740CC8612+2814146]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C987DC+2617996]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740C75C4C+2475772]
        v8::Unwinder::PCIsInV8 [0x00007FF7404A958F+943]
        v8::Unwinder::PCIsInV8 [0x00007FF7404A9CCC+2796]
        v8::Unwinder::PCIsInV8 [0x00007FF7404A9DC7+3047]
        v8::Unwinder::PCIsInV8 [0x00007FF7404C8D38+129880]
        v8::OutputStream::WriteHeapStatsChunk [0x00007FF73FAAA427+150023]
        v8::OutputStream::WriteHeapStatsChunk [0x00007FF73FAA9F9B+148859]
        v8_inspector::V8StackTraceId::ToString [0x00007FF7414D6E0A+11262138]
        uv_cond_signal [0x00007FF741771200+654064]
        GetHandleVerifier [0x00007FF741DF7045+965461]
        GetHandleVerifier [0x00007FF741DF70C1+965585]
        uv_loadavg [0x00007FF741691F31+1001553]
        uv_gettimeofday [0x00007FF741D01179+91545]
        uv_gettimeofday [0x00007FF741D00F01+90913]
        uv_gettimeofday [0x00007FF741CF3AAC+36556]
        uv_gettimeofday [0x00007FF741D01988+93608]
        uv_loadavg [0x00007FF74167E17E+920222]
        uv_mutex_unlock [0x00007FF741C584A2+1073826]
        v8_inspector::V8StackTraceId::ToString [0x00007FF740EAEAF1+4806049]
        IsSandboxedProcess [0x00007FF741B26644+153524]
        v8::HeapStatistics::total_heap_size [0x00007FF7402EE266+322198]
        Ordinal0 [0x00007FF73F96140B+5131]
        node::AsyncResource::CallbackScope::CallbackScope [0x00007FF7446804B2+20912194]
        BaseThreadInitThunk [0x00007FFC11997974+20]
        RtlUserThreadStart [0x00007FFC13B4A271+33]

Please lmk if there is anything you want me to test.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions