NDB Crashes with CharacterIdMap ran out of capacity!
See original GitHub issueEnvironment:
- ndb version: 1.1.3
- Platform / OS version: macOS 10.14.5
- Node.js version: 10.16 (also 12.6)
Problem
After opening NDB it crashes within a few seconds with a “CharacterIdMap ran out of capacity!” error.
Full stack trace
Error: Error: CharacterIdMap ran out of capacity!
Error: CharacterIdMap ran out of capacity!
at Common.CharacterIdMap.toChar (https://domain/ndb.js:1:141718)
at https://domain/ndb.js:3:160732
at Array.map (<anonymous>)
at Persistence.PathEncoder.encode (https://domain/ndb.js:3:160711)
at Persistence.Automapping.FilePathIndex.addPath (https://domain/ndb.js:3:142687)
at Persistence.Automapping._onUISourceCodeAdded (https://domain/ndb.js:3:137592)
at https://domain/ndb.js:3:135752
at Workspace.Workspace.dispatchEventToListeners (https://domain/ndb.js:1:91157)
at Persistence.FileSystemWorkspaceBinding.FileSystem.addUISourceCode (https://domain/ndb.js:1:658103)
at Persistence.FileSystemWorkspaceBinding.FileSystem._fileChanged (https://domain/ndb.js:3:134868)
at Rpc.dispatchMessageLocally_ (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/carlo/rpc/rpc.js:423:16)
at Rpc.routeMessage_ (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/carlo/rpc/rpc.js:371:12)
at process.emit (events.js:198:13)
at emit (internal/child_process.js:832:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
events.js:174
throw er; // Unhandled 'error' event
^
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at ChildProcess.target.send (internal/child_process.js:636:16)
at Rpc.routeMessage_ (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/carlo/rpc/rpc.js:379:9)
at page_.exposeFunction.data (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/carlo/lib/carlo.js:388:71)
at Page._onBindingCalled (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/puppeteer-core/lib/Page.js:548:56)
at CDPSession.Page.client.on.event (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/puppeteer-core/lib/Page.js:136:54)
at CDPSession.emit (events.js:198:13)
at CDPSession._onMessage (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/puppeteer-core/lib/Connection.js:200:12)
at Connection._onMessage (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/puppeteer-core/lib/Connection.js:112:17)
at PipeTransport._dispatch (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/puppeteer-core/lib/PipeTransport.js:59:22)
at Socket.PipeTransport._eventListeners.helper.addEventListener.buffer (/Users/jamesernator/.nvm/versions/node/v10.16.0/lib/node_modules/ndb/node_modules/puppeteer-core/lib/PipeTransport.js:30:64)
Emitted ‘error’ event at:
at process.nextTick (internal/child_process.js:640:35)
at process._tickCallback (internal/process/next_tick.js:61:11)
This is almost certainly due to the number of files in the repository (280687 or 100247 without node_modules/) as the issue does not occur in more narrow folders.
It’s still a pain though because if navigating to inner folders npm scripts cannot be used from NDB and it also changes the working directory breaking some of the scripts.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:8

Top Related StackOverflow Question
Getting this issue too. Running ndb against a bundle in a big repo. Unfortunately, just putting ndb in a different folder isn’t a solution here as I’m using it as part of the debug mode for a tool I’m making and I don’t know where the people using the tool are going to have ndb installed.
Version of ndb:
v1.1.5(latest) OS: MacOS 10.15.5Crashes when files load, ether loading in the sidebar or when certain files are already open in the editor, but haven’t been able to identify exact pattern.
Will crash when I try to load with sourcemaps, although it is possible that I’m loading them incorrectly. I can’t check though because ndb keeps crashing before any sourcemaps have the ability to load!
Sometimes crashes in two stages, with
Error: CharacterIdMap ran out of capacity!appearing first without the window crashing, and then when the window is closed normally it’ll showError [ERR_IPC_CHANNEL_CLOSED]: Channel closed. Still haven’t figured out the pattern for when it outright crashes and when it throws but doesn’t crash.If I just run
ndb(no arguments) and leave the window open, it will eventually either err or completely crash.@Whoaa512 I keep my “global” installs in my home directory, under
~/bin/node_modules, and I add~/bin/node_modules/.binto myPATHenvironment variable.That way