jm-david / emoji-mart-vue

One component to pick them all 👊🏼
https://jm-david.github.io/emoji-mart-vue
BSD 3-Clause "New" or "Revised" License
603 stars 82 forks source link

Can't compile scripts in production with webpack #20

Open ferdinandfrank opened 6 years ago

ferdinandfrank commented 6 years ago

Thanks for the package, it's awesome! But, whenever I try to compile my scripts using Laravel Mix (Webpack) in production environment, I run out of memory:

<--- Last few GCs --->

[5232:000001D7A8C2B980]   512215 ms: Mark-sweep 1322.7 (1474.3) -> 1322.6 (1475.3) MB, 1064.4 / 0.0 ms  allocation failure GC in old space requested
[5232:000001D7A8C2B980]   513219 ms: Mark-sweep 1322.6 (1475.3) -> 1322.6 (1433.8) MB, 1003.3 / 0.0 ms  last resort GC in old space requested
[5232:000001D7A8C2B980]   514344 ms: Mark-sweep 1322.6 (1433.8) -> 1322.6 (1429.3) MB, 1124.8 / 0.0 ms  last resort GC in old space requested

<--- JS stacktrace --->

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

Security context: 0000031A710A57C1 <JSObject>
    1: def_variable [000000B4F1B022D1 <undefined>:~5188] [pc=00000252B8505851](this=0000011D227B1DC9 <AST_Function map = 00000393AB303331>,symbol=0000011D227B2631 <AST_SymbolFunarg map = 000003289A5C9FD9>,init=000000B4F1B022D1 <undefined>)
    2: visit [000000B4F1B022D1 <undefined>:~4887] [pc=00000252B8BC76F4](this=00000174D3A7F9C9 <TreeWalker map = 000000E8947D8839>,node=0000011D227B2631 <AST...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node_module_register
 2: v8::internal::FatalProcessOutOfMemory
 3: v8::internal::FatalProcessOutOfMemory
 4: v8::internal::Factory::NewFixedArray
 5: v8::internal::HashTable<v8::internal::SeededNumberDictionary,v8::internal::SeededNumberDictionaryShape>::IsKey
 6: v8::internal::HashTable<v8::internal::SeededNumberDictionary,v8::internal::SeededNumberDictionaryShape>::IsKey
 7: v8::internal::StringTable::LookupString
 8: v8::internal::StringTable::LookupString
 9: v8::internal::SourcePositionTableIterator::Advance
10: v8::internal::SourcePositionTableIterator::Advance
11: 00000252B72043C1
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the @ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

However, on normal development environment everything works fine. As soon, as I completely remove the code where I use the package everything works fine, too. Anyone knows the problem?

My production npm script is the following:

cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js