Spectrum is now read-only. Learn more about the decision in our official announcement.

Truffle Suite

Sweet tools for smart contracts


TypeError: Cannot read property 'replace' of undefined I keep seeing this…

March 13, 2019 at 6:39pm

TypeError: Cannot read property 'replace' of undefined I keep seeing this message when using truffle debug for most of the steps when debugging almost any contract. I have no idea what it means and seems to have little to do with the smart contract that I am debugging. (Truffle v5.0.3)

March 13, 2019 at 6:39pm

March 13, 2019 at 7:46pm
Try upgrading to the latest verison of Truffle, there have been a number of debugger enhancements since 5.0.3
Hi, already tried that on a VM but couldn't got past the compilation. Again doesn't seem to have a lot to do with the source. (this is a clean with only nvm and node)
ooh that's interesting. are you running that with some instrumentation turned on? or is that just out of the box output
$ truffle compile
Compiling your contracts...
<--- Last few GCs --->
io[1722:0x33d5950] 39735 ms: Mark-sweep 1406.5 (1433.1) -> 1406.2 (1436.1) MB, 1504.8 / 0.0 ms (+ 43.9 ms in 48 steps since start of marking, biggest step 41.0 ms, walltime since start of marking 1599 ms) (average mu = 0.082, current mu = 0.032) allocat[1722:0x33d5950] 41292 ms: Mark-sweep 1409.3 (1436.1) -> 1408.9 (1438.6) MB, 1458.6 / 0.0 ms (+ 48.1 ms in 50 steps since start of marking, biggest step 44.4 ms, walltime since start of marking 1557 ms) (average mu = 0.059, current mu = 0.032) allocat
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x620b81dbe1d]
1: StubFrame [pc: 0x620b81934b0]
Security context: 0x06162021e6e1 <JSObject>
2: /* anonymous */ [0x3dc0d54f2a99] [/home/ccolorado/Source/nobservices/nobblockchain/node_modules/babylon/lib/index.js:~3794] [pc=0x620b84ad70d](this=0x23e155a53a29 <Parser map = 0x18be74394001>,startPos=0x2af9fdd822b1 <null>,startLoc=0x2af9fdd822b1 <null>,canBeArrow=0x2af9fdd828c9 <true>)
3: /* anonymous */ [0x3d...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x8db900 node::Abort() [node]
2: 0x8db94c [node]
3: 0xad6c1e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xad6e54 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xec44e2 [node]
6: 0xec45e8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
7: 0xed06c2 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xed0ff4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xed3c61 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xe9d0e4 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]
11: 0x113c88e v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]
12: 0x620b81dbe1d
Aborted (core dumped)
I will ask around to see if others have heard of causes for JS heap running out
can you make an issue for the out of memory problem? seems like no one knows about this problem offhand
oh, huh, it's new!
well, rest assured we're looking into this pronto.
Hey , do you have a specific project that I can clone and try and reproduce your error?
Pretty sure this is source agnostic, but here, just created a repo with some throw away code

March 14, 2019 at 8:10pm
I have no problem compiling certain projects on my local but the one you pointed me to on the Truffle issue crashes. Very strange. I'm going to be looking at it...I'll keep you posted.
If I copy the contracts from that project into another there is no problem compiling...I think there is some mysterious problem concerning the directory in which compilers are cached.

March 15, 2019 at 5:44pm
I found a conflict withe babel-register that is causing it to fail.

March 17, 2019 at 10:46pm
Great, I'll check it out