Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Trubble running #2

Open
owodunni opened this issue Mar 25, 2020 · 0 comments
Open

Trubble running #2

owodunni opened this issue Mar 25, 2020 · 0 comments

Comments

@owodunni
Copy link

Hi,

Using node v10.19.0 I get some errors when trying to run this code.

Whenever I try to modify the createSet function I get the following error:

<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0x32231e45be1d]
Security context: 0x329df719e6e9 <JSObject>
    1: byteLength(aka byteLength) [0x382051f796c1] [buffer.js:531] [bytecode=0x19b923b23059 offset=204](this=0x1c57609826f1 <undefined>,string=0x2911cf993c39 <Very long string[101471104]>,encoding=0x329df71bddb1 <String[4]: utf8>)
    2: arguments adaptor frame: 3->2
    3: fromString(aka fromString) [0x3e5e833932e9] [buffer.js:342] [bytecode=0x19b923b1d0f9 ...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x8fa090 node::Abort() [/usr/local/bin/node]
 2: 0x8fa0dc  [/usr/local/bin/node]
 3: 0xb0052e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 4: 0xb00764 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 5: 0xef4c72  [/usr/local/bin/node]
 6: 0xf0448f v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
 7: 0xed403b v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 8: 0x101d8c3 v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/usr/local/bin/node]
 9: 0xafded4 v8::internal::String::Flatten(v8::internal::Handle<v8::internal::String>, v8::internal::PretenureFlag) [/usr/local/bin/node]
10: 0xb0b8a0 v8::String::Utf8Length() const [/usr/local/bin/node]
11: 0x913629  [/usr/local/bin/node]
12: 0xb8e96f  [/usr/local/bin/node]
13: 0xb8f4d9 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
14: 0x32231e45be1d 
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I have tried running node with more memory to mitigate this:

    "mem-start": "node --max_old_space_size=4096 ./node_modules/.bin/react-scripts start",

Here is my modification:


  async createSet() {
    console.log("create set");
    const { setProtocol } = this.state;
    console.log(setProtocol)

    /**
      * Steps to create your own Set Token
      * ----------------------------------
      *
      * 1. Fund your MetaMask wallet with Kovan ETH: https://gitter.im/kovan-testnet/faucet
      * 2. Modify your Set details below to your liking
      * 3. Click `Create My Set`
      */
    const trueUsdAddress = '0xadb015d61f4beb2a712d237d9d4c5b75bafefd7b';

I also get issues in the chrome console:

Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
contentscript.js:1 MetamaskContentscript - lost connection to MetaMask Background Multiplex
d @ contentscript.js:1
contentscript.js:1 MetamaskContentscript - lost connection to MetaMask muxed traffic for channel "provider" failed.
d @ contentscript.js:1
contentscript.js:1 MetamaskContentscript - lost connection to MetaMask muxed traffic for channel "publicConfig" failed.
d @ contentscript.js:1
localhost/:1 Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
source-map-support.js:124 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
retrieveSourceMapURL @ source-map-support.js:124
inpage.js:1 Error: Possible EventEmitter memory leak detected. 101 data listeners added. Use emitter.setMaxListeners() to increase limit
f @ inpage.js:1
webpackHotDevClient.js:138 ./node_modules/set-protocol-oracles/dist/utils/web3Helper.js
116:19-36 Critical dependency: the request of a dependency is an expression
printWarnings @ webpackHotDevClient.js:138
webpackHotDevClient.js:138 ./node_modules/set-protocol-contracts/dist/utils/web3Helper.js
142:19-36 Critical dependency: the request of a dependency is an expression
printWarnings @ webpackHotDevClient.js:138
webpackHotDevClient.js:138 ./node_modules/@truffle/contract/node_modules/web3-eth-accounts/src/scrypt.js
17:50-60 Critical dependency: the request of a dependency is an expression
printWarnings @ webpackHotDevClient.js:138
webpackHotDevClient.js:138 ./node_modules/@truffle/interface-adapter/node_modules/web3-eth-accounts/src/scrypt.js
17:50-60 Critical dependency: the request of a dependency is an expression
printWarnings @ webpackHotDevClient.js:138
webpackHotDevClient.js:138 ./node_modules/source-map-support/source-map-support.js
Module not found: Can't resolve 'module' in '/home/owodunni/Prog/algoBot/set/node_modules/source-map-support'
printWarnings @ webpackHotDevClient.js:138
DevTools failed to parse SourceMap: chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/contentscript.js.map
DevTools failed to parse SourceMap: chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map
react_devtools_backend.js:6 MetaMask: web3 will be deprecated in the near future in favor of the ethereumProvider
https://medium.com/metamask/4a899ad6e59e
r @ react_devtools_backend.js:6
get @ inpage.js:1
getAccount @ App.js:102
_callee$ @ App.js:58
tryCatch @ runtime.js:62
invoke @ runtime.js:296
prototype.<computed> @ runtime.js:114
step @ App.css?9a66:26
(anonymous) @ App.css?9a66:26
(anonymous) @ App.css?9a66:26
createSet @ App.js:75
callCallback @ react-dom.development.js:145
invokeGuardedCallbackDev @ react-dom.development.js:195
invokeGuardedCallback @ react-dom.development.js:248
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:262
executeDispatch @ react-dom.development.js:593
executeDispatchesInOrder @ react-dom.development.js:615
executeDispatchesAndRelease @ react-dom.development.js:713
executeDispatchesAndReleaseTopLevel @ react-dom.development.js:724
forEachAccumulated @ react-dom.development.js:694
runEventsInBatch @ react-dom.development.js:855
runExtractedEventsInBatch @ react-dom.development.js:864
handleTopLevel @ react-dom.development.js:4857
batchedUpdates$1 @ react-dom.development.js:17498
batchedUpdates @ react-dom.development.js:2189
dispatchEvent @ react-dom.development.js:4936
interactiveUpdates$1 @ react-dom.development.js:17553
interactiveUpdates @ react-dom.development.js:2208
dispatchInteractiveEvent @ react-dom.development.js:4913
VM84:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at Object.parse (<anonymous>)
    at Object.parseSourceMapInput (util.js:433)
    at new SourceMapConsumer (source-map-consumer.js:17)
    at mapSourcePosition (source-map-support.js:190)
    at wrapCallSite (source-map-support.js:367)
    at Function.prepareStackTrace (source-map-support.js:416)
    at parseError (index.js:2367)
    at getStackFrames (index.js:2263)
    at crashWithFrames (index.js:1927)
    at index.js:1945
    at rejectionHandler (index.js:2041)
parseSourceMapInput @ util.js:433
SourceMapConsumer @ source-map-consumer.js:17
mapSourcePosition @ source-map-support.js:190
wrapCallSite @ source-map-support.js:367
prepareStackTrace @ source-map-support.js:416
parseError @ index.js:2367
getStackFrames @ index.js:2263
crashWithFrames @ index.js:1927
(anonymous) @ index.js:1945
rejectionHandler @ index.js:2041
inpage.js:1 Uncaught (in promise) Error: Invalid JSON RPC response: undefined
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant