sql-js / sql.js

A javascript library to run SQLite on the web.
http://sql.js.org
Other
12.67k stars 1.06k forks source link

Error in webpack build #212

Open jlanio opened 7 years ago

jlanio commented 7 years ago

I'm having the following error return by including when importing the lib (using webpack)

<--- Last few GCs --->

[10376:0000021F7CCE6A80] 91373 ms: Mark-sweep 1403.6 (1471.6) -> 1403.6 (1471.6) MB, 3185.3 / > 0.0 ms allocation failure GC in old space requested [10376:0000021F7CCE6A80] 94535 ms: Mark-sweep 1403.6 (1471.6) -> 1403.5 (1441.6) MB, 3162.2 / > 0.0 ms last resort gc [10376:0000021F7CCE6A80] 98458 ms: Mark-sweep 1403.5 (1441.6) -> 1403.5 (1441.6) MB, 3922.3 / > 0.0 ms last resort gc

<--- JS stacktrace --->

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

Security context: 000003E47A5C0D59 1: get [C:...\node_modules\babel-traverse\lib\path\index.js:~76] > [pc=000003FB7F207CC0](this=00000398E240A6F1 <JS Function NodePath (SharedFunctionInfo > 0000031798DE04C1)>,_ref=00000181DD2CF4D1 <an Object with map 000001C7B096A2D1>) > 2: node [C:...\node_modules\babel-traverse\lib\index.js:~94] > [pc=000003FB7F1BBFC8](this=000002C01A19F381 <...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

karlb commented 5 years ago

Node is running out of memory during the build. You can allow it to use more memory by setting an environment variable:

export NODE_OPTIONS=--max_old_space_size=4096

At least this was the problem for me with a similar error.

lovasoa commented 4 years ago

Hello, I'm going to close this old issue, let me know if I should reopen it.

If you need to use sql.js with webpack, you can follow this example: https://github.com/sql-js/react-sqljs-demo