Premium support for our pure JavaScript UI components


Post by era »

The building of the project takes incredible long to compile and I always get the warning:

[BABEL] Note: The code generator has deoptimised the styling of [...PATH/TO/PROJECT...]\src\bryntum-scheduler\build\scheduler.umd.js 
as it exceeds the max of 500KB.

Sometimes the compiling crashes the instance running with the error. And on our server the build fails every time. Do you have any tips on how to solve this? Like make Babel ignore the scheduler? Is it source-maps? I already made eslint ignore the folders for bryntum.

More info:

<--- Last few GCs --->

[3668:000001954229B7E0]  3058337 ms: Mark-sweep 1376.5 (1448.5) -> 1366.8 (1452.0) MB, 964.6 / 0.0 ms  (average mu = 0.131, current mu = 0.031) allocation failure scavenge might not succeed
[3668:000001954229B7E0]  3059339 ms: Mark-sweep 1380.1 (1452.0) -> 1370.3 (1455.5) MB, 970.8 / 0.0 ms  (average mu = 0.083, current mu = 0.032) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 0000008DCC2DC5C1]
Security context: 0x001ac461e6e9 <JSObject>
    1: exec [0000001AC4609239](this=0x03914c62d001 <JSRegExp <String[2]: \\>>,0x02eeaf4879c1 <String[63]: [PATH-TO-PROJECT]\src\bryntum-scheduler\build\scheduler.umd.js>)
    2: InternalFrame [pc: 0000008DCC28F0B6]
    3: EntryFrame [pc: 0000008DCC289455]
    4: ExitFrame [pc: 0000008DCC2DC5C1]
    5: [Symbol.replace] [0000001AC46095D1](this=0x03914c62d00...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 00007FF76EDBF04A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+5114
 2: 00007FF76ED9A0C6 node::MakeCallback+4518
 3: 00007FF76ED9AA30 node_module_register+2032
 4: 00007FF76F0220EE v8::internal::FatalProcessOutOfMemory+846
 5: 00007FF76F02201F v8::internal::FatalProcessOutOfMemory+639
 6: 00007FF76F542BC4 v8::internal::Heap::MaxHeapGrowingFactor+9556
 7: 00007FF76F539C46 v8::internal::ScavengeJob::operator=+24310
 8: 00007FF76F53829C v8::internal::ScavengeJob::operator=+17740
 9: 00007FF76F540F87 v8::internal::Heap::MaxHeapGrowingFactor+2327
10: 00007FF76F541006 v8::internal::Heap::MaxHeapGrowingFactor+2454
11: 00007FF76F0FCDB7 v8::internal::Factory::NewFillerObject+55
12: 00007FF76F192CC6 v8::internal::WasmJs::Install+29414
13: 0000008DCC2DC5C1
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! frontend-build-tools@1.0.0 app-serve: `babel-node ./build/app.serve.js --revision=false`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the frontend-build-tools@1.0.0 app-serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I installed the Bryntum Scheduler as a local module located in our repo, and linked in package.json like this:

"bryntum-scheduler": "file:src/bryntum-scheduler/build"

Then I'm importing the scheduler like this.

import { Scheduler, ObjectHelper, Widget } from 'bryntum-scheduler/scheduler.umd';

Post by arcady »

Could be source maps yes. The bundle is quite big so building them could eat memory. One option to try is disabling them. Here is 1st link I've just googled: https://stackoverflow.com/questions/51984146/how-to-disable-source-maps-for-react-js-application

Or another option is increasing heap space: https://stackoverflow.com/questions/38558989/node-js-heap-out-of-memory

Please let us know if it helped!


Post by era »

Disabling the source-maps helped.

We're looking into ways of excluding just the bryntum-scheduler from our source-maps right now. If you have a solution for this, or maybe in the future, it would be a great thing to have a chapter for in the documentation ;-)


Post by pmiklashevich »

"bryntum-scheduler": "file:src/bryntum-scheduler/build"

It looks like you put sources under the working project. Please always keep bryntum libs outside of the project, so transpilers do not try to process them

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply