I honestly don’t know what is causing this.
I am using ES6 and wokring in Visual Studio Code,
When inspector is not called I can compile with this warning which is annoying, but things still work and i get what it says, the compiled file is large. Though that is odd as I am using tree shaking, and not really using much of anything, it does not seem to hurt anything and I am just developing so no big deal.
npm run-script build
> play-with-technology@0.0.1 build D:\Desktop\webProjects\pwt\web
> npx webpack --config webpack.prod.js
Hash: 5ca9dfae899cf476b1b2
Version: webpack 4.44.2
Time: 35930ms
Built at: 10/19/2020 10:21:21 PM
Asset Size Chunks Chunk Names
src/pwtEngine.js 3.05 MiB 0 [emitted] [big] main
src/pwtEngine.js.map 11.6 MiB 0 [emitted] [dev] main
Entrypoint main [big] = src/pwtEngine.js src/pwtEngine.js.map
[19] ./node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js + 9 modules 27.6 KiB {0} [built]
| 10 modules
[29] (webpack)/buildin/global.js 472 bytes {0} [built]
[30] ./src/index.ts + 852 modules 7.71 MiB {0} [built]
| ./src/index.ts 1.93 KiB [built]
| ./src/pwt.ts 1.13 KiB [built]
| ./src/dataLoader.ts 6.83 KiB [built]
| ./src/interface.ts 3.23 KiB [built]
| ./src/world.ts 760 bytes [built]
| ./src/camera.ts 1.13 KiB [built]
| ./src/globalEnvironment.ts 2.59 KiB [built]
| + 846 hidden modules
+ 28 hidden modules
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
src/pwtEngine.js (3.05 MiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
main (3.05 MiB)
src/pwtEngine.js
WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
BUT when I include inspector in my project, I get critical error
npm run-script build
> play-with-technology@0.0.1 build D:\Desktop\webProjects\pwt\web
> npx webpack --config webpack.prod.js
<--- Last few GCs --->
[4388:0000020E48168FA0] 56259 ms: Scavenge 1372.4 (1422.7) -> 1371.7 (1423.2) MB, 2.7 / 0.0 ms (average mu = 0.194, current mu = 0.145) allocation failure
[4388:0000020E48168FA0] 56264 ms: Scavenge 1372.6 (1423.2) -> 1372.1 (1423.7) MB, 3.0 / 0.0 ms (average mu = 0.194, current mu = 0.145) allocation failure
[4388:0000020E48168FA0] 56269 ms: Scavenge 1372.8 (1423.7) -> 1372.6 (1425.2) MB, 2.9 / 0.0 ms (average mu = 0.194, current mu = 0.145) allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0000010597F5C5C1]
Security context: 0x03af9719e6e9 <JSObject>
1: new SourceNode [0000025B83D0CA79] [D:\Desktop\webProjects\pwt\web\node_modules\webpack-sources\node_modules\source-map\lib\source-node.js:~35] [pc=00000105986B11C0](this=0x034ad552f2d1 <SourceNode map = 0000001A5102ABB1>,aLine=85,aColumn=17,aSource=0x0262b1341041 <String[67]: ../../../../sourceES6/core/Materials/Node/nodeMaterialBuildState.ts>,aChun...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF69C71DD8A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506
2: 00007FF69C6F8886 node::MakeCallback+4534
3: 00007FF69C6F9200 node_module_register+2032
4: 00007FF69CA130DE v8::internal::FatalProcessOutOfMemory+846
5: 00007FF69CA1300F v8::internal::FatalProcessOutOfMemory+639
6: 00007FF69CBF9804 v8::internal::Heap::MaxHeapGrowingFactor+9620
7: 00007FF69CBF07E6 v8::internal::ScavengeJob::operator=+24550
8: 00007FF69CBEEE3C v8::internal::ScavengeJob::operator=+17980
9: 00007FF69CBF7B87 v8::internal::Heap::MaxHeapGrowingFactor+2327
10: 00007FF69CBF7C06 v8::internal::Heap::MaxHeapGrowingFactor+2454
11: 00007FF69CD21EA7 v8::internal::Factory::NewFillerObject+55
12: 00007FF69CD9F096 v8::internal::operator<<+73494
13: 0000010597F5C5C1
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! play-with-technology@0.0.1 build: `npx webpack --config webpack.prod.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the play-with-technology@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2020-10-20T03_27_44_138Z-debug.log
Any thoughts? Googling says likely a memory leak, but since I am only compiling, wouldn’t that be a leak in VSCODE? Why only manifest when inspector? is inspector leaking?