Nuxt.js fails to start up with auth module - javascript

npx create-nuxt-app client and set it up. Run npm run dev and everything works.
I start auth setup with npm install #nuxtjs/auth
add '#nuxtjs/auth' module in nuxt.config.js
add example auth strategy like so
auth: {
strategies: {
local: {
endpoints: {
login: { url: '/api/login', method: 'post' },
},
tokenRequired: false,
tokenType: false
}
}
},
Add the example vue store and save it in store/index.js:
export const state = () => ({
counter: 0
})
export const mutations = {
increment(state) {
state.counter++
}
}
I run npm run dev, everything compiles and init message shows to go to http://localhost:3000/. Trying to load it in the browser, the URL continues to load after initial loading and does not end. Node process starts to use 100% of the CPU and after several minutes prints this and quits:
<--- Last few GCs --->
[34438:0x38ef0c0] 323677 ms: Scavenge 2003.9 (2048.6) -> 2003.2 (2049.1) MB, 10.9 / 0.0 ms (average mu = 0.209, current mu = 0.192) allocation failure
[34438:0x38ef0c0] 323728 ms: Scavenge 2004.6 (2049.6) -> 2004.0 (2049.9) MB, 12.4 / 0.0 ms (average mu = 0.209, current mu = 0.192) allocation failure
[34438:0x38ef0c0] 323778 ms: Scavenge 2005.4 (2050.4) -> 2004.8 (2050.6) MB, 10.9 / 0.0 ms (average mu = 0.209, current mu = 0.192) allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x13cf019]
Security context: 0x29f654d808d1 <JSObject>
1: inspect(aka inspect) [0x32d8b34ca9f9] [internal/util/inspect.js:~240] [pc=0xee1e7f4f44c](this=0x1cbf81fc04b1 <undefined>,0x29f654d98bc1 <JSFunction Boolean (sfi = 0x3f35983d3769)>,0x02b5724d8a71 <Object map = 0x1bc8fcdd6919>)
2: /* anonymous */ [0x9a2eaaec139] [/home/myUserName/Documents/projectFile/client/node_modules/esm/esm.js:~1] [pc=0xee1e7e6e063](...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xa093f0 node::Abort() [node]
2: 0xa097fc node::OnFatalError(char const*, char const*) [node]
3: 0xb842ae v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xb84629 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xd30fe5 [node]
6: 0xd31676 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
7: 0xd3def5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xd3eda5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xd4185c v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xd0830b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
11: 0x1049f4e v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x13cf019 [node]
Aborted
I tried this start to finish with node v10.15.3 and v12.18.3, the same result. Versions from package.json:
"dependencies": {
"#nuxtjs/auth": "^4.9.1",
"#nuxtjs/axios": "^5.12.0",
"bootstrap": "^4.5.0",
"bootstrap-vue": "^2.15.0",
"nuxt": "^2.14.0"
}
and npx create-nuxt-app --version shows create-nuxt-app/3.2.0 linux-x64 node-v12.18.3. OS is Solus 4.1 Fortitude.
What is going wrong here? If this is a known bug, are there versions/workaround that works?

Setting baseURL property under for axios in nuxt.config.js solved my issue:
axios: {
baseURL: '/'
}

Related

Node.js application error when deploying on heroku

My program crashes. the website does not even load for a second. It loads until the program crashes. I tried changing the JSON and the Procfile but nothing seems to work. I tried restarting Heroku and I have no env variables, but nothing worked though.
Here are the Heroku logs:
2023-02-05T23:53:55.000000+00:00 app[api]: Build succeeded
2023-02-05T23:54:01.544863+00:00 heroku[web.1]: Starting process with command `npm start`
2023-02-05T23:54:03.163211+00:00 app[web.1]:
2023-02-05T23:54:03.163238+00:00 app[web.1]: > modal-react#0.1.0 start /app
2023-02-05T23:54:03.163238+00:00 app[web.1]: > react-scripts start
2023-02-05T23:54:03.163239+00:00 app[web.1]:
2023-02-05T23:54:05.047020+00:00 heroku[web.1]: State changed from starting to up
2023-02-05T23:54:04.946662+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.18.62.238/
2023-02-05T23:54:04.946860+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2023-02-05T23:54:04.946902+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2023-02-05T23:54:04.946928+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2023-02-05T23:54:04.947288+00:00 app[web.1]: Starting the development server...
2023-02-05T23:54:04.947288+00:00 app[web.1]:
2023-02-05T23:54:36.531206+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=mymedicineislqatar.herokuapp.com request_id=39c2b9ef-437e-4436-ad00-3112613f8575 fwd="37.210.130.204" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https
2023-02-05T23:54:39.448024+00:00 app[web.1]:
2023-02-05T23:54:39.448049+00:00 app[web.1]: <--- Last few GCs --->
2023-02-05T23:54:39.448049+00:00 app[web.1]:
2023-02-05T23:54:39.448050+00:00 app[web.1]: [27:0x52a4a20] 35980 ms: Scavenge (reduce) 244.9 (256.0) -> 244.4 (257.3) MB, 0.6 / 0.0 ms (average mu = 0.769, current mu = 0.791) allocation failure
2023-02-05T23:54:39.448050+00:00 app[web.1]: [27:0x52a4a20] 35984 ms: Scavenge (reduce) 245.0 (256.3) -> 244.7 (257.5) MB, 0.6 / 0.0 ms (average mu = 0.769, current mu = 0.791) allocation failure
2023-02-05T23:54:39.448051+00:00 app[web.1]: [27:0x52a4a20] 35987 ms: Scavenge (reduce) 245.3 (256.5) -> 244.8 (257.8) MB, 0.5 / 0.0 ms (average mu = 0.769, current mu = 0.791) allocation failure
2023-02-05T23:54:39.448051+00:00 app[web.1]:
2023-02-05T23:54:39.448055+00:00 app[web.1]:
2023-02-05T23:54:39.448055+00:00 app[web.1]: <--- JS stacktrace --->
2023-02-05T23:54:39.448055+00:00 app[web.1]:
2023-02-05T23:54:39.448056+00:00 app[web.1]: FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
2023-02-05T23:54:39.448844+00:00 app[web.1]: 1: 0xa24ed0 node::Abort() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.449459+00:00 app[web.1]: 2: 0x966115 node::FatalError(char const*, char const*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.450119+00:00 app[web.1]: 3: 0xb9acde v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.450762+00:00 app[web.1]: 4: 0xb9b057 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.451531+00:00 app[web.1]: 5: 0xd56ea5 [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.452289+00:00 app[web.1]: 6: 0xd87a8e v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.453046+00:00 app[web.1]: 7: 0xd93ac6 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.453790+00:00 app[web.1]: 8: 0xd7fc5f v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.454550+00:00 app[web.1]: 9: 0xd7fed8 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.455206+00:00 app[web.1]: 10: 0xd727b9 v8::internal::ItemParallelJob::Run() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.455880+00:00 app[web.1]: 11: 0xd95a20 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.456513+00:00 app[web.1]: 12: 0xd962bc v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.457199+00:00 app[web.1]: 13: 0xd96485 v8::internal::MarkCompactCollector::Evacuate() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.457819+00:00 app[web.1]: 14: 0xda8481 v8::internal::MarkCompactCollector::CollectGarbage() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.458407+00:00 app[web.1]: 15: 0xd64748 v8::internal::Heap::MarkCompact() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.459057+00:00 app[web.1]: 16: 0xd66238 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.459755+00:00 app[web.1]: 17: 0xd6967c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.460492+00:00 app[web.1]: 18: 0xd2ee1d v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.461168+00:00 app[web.1]: 19: 0xd2b079 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.461776+00:00 app[web.1]: 20: 0xd2b134 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.462477+00:00 app[web.1]: 21: 0xf6d5af v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::CollectKeysTo(v8::internal::Handle<v8::internal::NameDictionary>, v8::internal::KeyAccumulator*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.463220+00:00 app[web.1]: 22: 0xf2753b v8::internal::KeyAccumulator::CollectOwnPropertyNames(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.463897+00:00 app[web.1]: 23: 0xf2790f v8::internal::KeyAccumulator::CollectOwnKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.464596+00:00 app[web.1]: 24: 0xf28781 v8::internal::KeyAccumulator::CollectKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSReceiver>) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.465376+00:00 app[web.1]: 25: 0xf28edc v8::internal::FastKeyAccumulator::GetKeysSlow(v8::internal::GetKeysConversion) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.466182+00:00 app[web.1]: 26: 0xf29031 v8::internal::KeyAccumulator::GetKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::KeyCollectionMode, v8::internal::PropertyFilter, v8::internal::GetKeysConversion, bool, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.466983+00:00 app[web.1]: 27: 0xf177b3 v8::internal::JSReceiver::SetOrCopyDataProperties(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::ScopedVector<v8::internal::Handle<v8::internal::Object> > const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.467718+00:00 app[web.1]: 28: 0x1098060 v8::internal::Runtime_SetDataProperties(int, unsigned long*, v8::internal::Isolate*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.468516+00:00 app[web.1]: 29: 0x1427099 [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.495089+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2023-02-05T23:54:39.495260+00:00 app[web.1]: npm ERR! errno 1
2023-02-05T23:54:39.497846+00:00 app[web.1]: npm ERR! modal-react#0.1.0 start: `react-scripts start`
2023-02-05T23:54:39.497902+00:00 app[web.1]: npm ERR! Exit status 1
2023-02-05T23:54:39.497966+00:00 app[web.1]: npm ERR!
2023-02-05T23:54:39.498018+00:00 app[web.1]: npm ERR! Failed at the modal-react#0.1.0 start script.
2023-02-05T23:54:39.498066+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2023-02-05T23:54:39.504341+00:00 app[web.1]:
2023-02-05T23:54:39.504445+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2023-02-05T23:54:39.504504+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2023-02-05T23_54_39_498Z-debug.log
2023-02-05T23:54:39.629101+00:00 heroku[web.1]: Process exited with status 1
2023-02-05T23:54:39.489515+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/favicon.ico" host=mymedicineislqatar.herokuapp.com request_id=f91207ad-031d-45e5-8b63-bdb0b7dff9a6 fwd="37.210.130.204" dyno=web.1 connect=0ms service=2512ms status=503 bytes=0 protocol=https
2023-02-05T23:54:39.701388+00:00 heroku[web.1]: State changed from up to crashed
2023-02-05T23:54:39.706529+00:00 heroku[web.1]: State changed from crashed to starting
2023-02-05T23:54:49.290975+00:00 heroku[web.1]: Starting process with command `npm start`
2023-02-05T23:54:50.883106+00:00 app[web.1]:
2023-02-05T23:54:50.883138+00:00 app[web.1]: > modal-react#0.1.0 start /app
2023-02-05T23:54:50.883140+00:00 app[web.1]: > react-scripts start
2023-02-05T23:54:50.883140+00:00 app[web.1]:
2023-02-05T23:54:52.657245+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.18.245.202/
2023-02-05T23:54:52.657424+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2023-02-05T23:54:52.657465+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2023-02-05T23:54:52.657494+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2023-02-05T23:54:52.657852+00:00 app[web.1]: Starting the development server...
2023-02-05T23:54:52.657853+00:00 app[web.1]:
2023-02-05T23:54:53.193812+00:00 heroku[web.1]: State changed from starting to up
2023-02-05T23:55:28.206144+00:00 app[web.1]:
2023-02-05T23:55:28.206176+00:00 app[web.1]: <--- Last few GCs --->
2023-02-05T23:55:28.206176+00:00 app[web.1]:
2023-02-05T23:55:28.206178+00:00 app[web.1]: [27:0x5606a20] 36994 ms: Scavenge (reduce) 245.1 (256.3) -> 244.5 (257.5) MB, 0.6 / 0.0 ms (average mu = 0.779, current mu = 0.780) allocation failure
2023-02-05T23:55:28.206179+00:00 app[web.1]: [27:0x5606a20] 37008 ms: Scavenge (reduce) 245.4 (256.5) -> 244.9 (257.5) MB, 0.9 / 0.0 ms (average mu = 0.779, current mu = 0.780) allocation failure
2023-02-05T23:55:28.206179+00:00 app[web.1]: [27:0x5606a20] 37019 ms: Scavenge (reduce) 245.7 (256.5) -> 245.2 (257.8) MB, 1.0 / 0.0 ms (average mu = 0.779, current mu = 0.780) allocation failure
2023-02-05T23:55:28.206179+00:00 app[web.1]:
2023-02-05T23:55:28.206184+00:00 app[web.1]:
2023-02-05T23:55:28.206184+00:00 app[web.1]: <--- JS stacktrace --->
2023-02-05T23:55:28.206185+00:00 app[web.1]:
2023-02-05T23:55:28.206201+00:00 app[web.1]: FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
2023-02-05T23:55:28.206802+00:00 app[web.1]: 1: 0xa24ed0 node::Abort() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.207254+00:00 app[web.1]: 2: 0x966115 node::FatalError(char const*, char const*) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.207773+00:00 app[web.1]: 3: 0xb9acde v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.208271+00:00 app[web.1]: 4: 0xb9b057 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.208861+00:00 app[web.1]: 5: 0xd56ea5 [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.209460+00:00 app[web.1]: 6: 0xd87a8e v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.210082+00:00 app[web.1]: 7: 0xd93ac6 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.210681+00:00 app[web.1]: 8: 0xd7fc5f v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.211286+00:00 app[web.1]: 9: 0xd7fed8 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.211906+00:00 app[web.1]: 10: 0xd727b9 v8::internal::ItemParallelJob::Run() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.212496+00:00 app[web.1]: 11: 0xd95a20 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.213095+00:00 app[web.1]: 12: 0xd962bc v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.213693+00:00 app[web.1]: 13: 0xd96485 v8::internal::MarkCompactCollector::Evacuate() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.214312+00:00 app[web.1]: 14: 0xda8481 v8::internal::MarkCompactCollector::CollectGarbage() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.214903+00:00 app[web.1]: 15: 0xd64748 v8::internal::Heap::MarkCompact() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.215517+00:00 app[web.1]: 16: 0xd66238 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.216130+00:00 app[web.1]: 17: 0xd6967c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.216707+00:00 app[web.1]: 18: 0xd2ee1d v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.217290+00:00 app[web.1]: 19: 0xd28ca4 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.217888+00:00 app[web.1]: 20: 0xd2acb0 v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.218557+00:00 app[web.1]: 21: 0xf8d18a v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle<v8::internal::ConsString>, v8::internal::AllocationType) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.219204+00:00 app[web.1]: 22: 0xf90565 v8::internal::String::SlowEquals(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::String>) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.219901+00:00 app[web.1]: 23: 0x10be8b7 v8::internal::Runtime_StringEqual(int, unsigned long*, v8::internal::Isolate*) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.220642+00:00 app[web.1]: 24: 0x1427099 [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.248461+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2023-02-05T23:55:28.248625+00:00 app[web.1]: npm ERR! errno 1
2023-02-05T23:55:28.251223+00:00 app[web.1]: npm ERR! modal-react#0.1.0 start: `react-scripts start`
2023-02-05T23:55:28.251271+00:00 app[web.1]: npm ERR! Exit status 1
2023-02-05T23:55:28.251326+00:00 app[web.1]: npm ERR!
2023-02-05T23:55:28.251371+00:00 app[web.1]: npm ERR! Failed at the modal-react#0.1.0 start script.
2023-02-05T23:55:28.251410+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2023-02-05T23:55:28.256461+00:00 app[web.1]:
2023-02-05T23:55:28.256545+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2023-02-05T23:55:28.256587+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2023-02-05T23_55_28_251Z-debug.log
2023-02-05T23:55:28.387360+00:00 heroku[web.1]: Process exited with status 1
2023-02-05T23:55:28.242228+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=mymedicineislqatar.herokuapp.com request_id=37e088cf-76a2-4ddf-803a-fa544c8aa355 fwd="37.210.130.204" dyno=web.1 connect=0ms service=19863ms status=503 bytes=0 protocol=https
2023-02-05T23:55:28.433328+00:00 heroku[web.1]: State changed from up to crashed
2023-02-05T23:55:33.626857+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mymedicineislqatar.herokuapp.com request_id=068075b9-bb44-4c91-8f0b-0cba807c2d87 fwd="37.210.130.204" dyno=web.1 connect=5002ms service= status=503 bytes= protocol=https
package.json file:
{
"name": "modal-react",
"version": "0.1.0",
"engines": {
"node": "14.17.1"
},
"private": true,
"dependencies": {
"#fontsource/manrope": "^4.5.11",
"#material-ui/core": "^4.11.4",
"#material-ui/icons": "^4.11.2",
"#testing-library/jest-dom": "^5.11.4",
"#testing-library/react": "^11.1.0",
"#testing-library/user-event": "^12.1.10",
"i": "^0.3.7",
"install": "^0.13.0",
"lightbox.js-react": "^0.3.3",
"npm": "^8.18.0",
"react": "^17.0.2",
"react-animated-slider": "^1.1.4",
"react-dom": "^17.0.2",
"react-icons": "^4.4.0",
"react-image-file-resizer": "^0.4.8",
"react-router-dom": "5.2.0",
"react-scripts": "4.0.3",
"react-slideshow-image": "^4.1.0",
"react-smart-slider": "^0.1.2",
"styled-components": "^5.3.5",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"nodemon": "^2.0.20"
}
}
Procfile:
web:npm start

Problems while deploying smart contract on Polygon mainnet

I'm trying to deploy a Smart Contract on Polygon mainnet but this happens when I run the migrate command using truffle
> Network name: 'matic'
> Network id: 137
> Block gas limit: 30176202 (0x1cc73ca)
1_initial_migration.js
======================
Deploying 'Animals'
-------------------
*** Deployment Failed ***
"Animals" -- transaction underpriced.
Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan.
Error: *** Deployment Failed ***
"Animals" -- transaction underpriced.
at /Users/nick/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:379:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Migration._deploy (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:68:1)
at Migration._load (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:54:1)
at Migration.run (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:202:1)
at Object.runMigrations (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/index.js:152:1)
at Object.runFrom (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/index.js:117:1)
at Object.runAll (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/index.js:121:1)
at Object.run (/Users/nick/node_modules/truffle/build/webpack:/packages/migrate/index.js:86:1)
at runMigrations (/Users/nick/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:78:1)
at Object.module.exports [as run] (/Users/nick/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:44:1)
at Command.run (/Users/nick/node_modules/truffle/build/webpack:/packages/core/lib/command.js:189:1)
Truffle v5.5.1 (core: 5.5.1)
This is my truffle-config.js
matic: {
provider: () => new HDWalletProvider(mnemonic, `https://polygon-mainnet.g.alchemy.com/v2/key`),
network_id: 137,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},
Does anyone know why is this happening?

Smart contracts won't deploy to a goQuorum blockchain

I installed goQuorum with quorum-wizard with 4 quorum nodes and 4 tessera nodes on IBFT. When I start the network with "./start.sh" I get
Starting Quorum network...
Waiting until all Tessera nodes are running...
Waiting until all Tessera nodes are running...
All Tessera nodes started
Starting Quorum nodes
Successfully started Quorum network.
--------------------------------------------------------------------------------
Tessera Node 1 public key:
BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo=
Tessera Node 2 public key:
QfeDAys9MPDs2XHExtc84jKGHxZg/aj52DTh0vtA3Xc=
Tessera Node 3 public key:
1iTZde/ndBHvzhcl7V68x44Vx7pl8nwx9LqnM/AfJUg=
Tessera Node 4 public key:
oNspPPgszVUFw0qmGFfWwh1uxVUXgvBxleXORHj07g8=
--------------------------------------------------------------------------------
when I run "nmap -p 21000-21100" I get
21000/tcp open irtrans
21001/tcp open unknown
21002/tcp open unknown
21003/tcp open unknown
This is my truffle-config.js
const HDWalletProvider = require("#truffle/hdwallet-provider");
const mnemonic = "not my real mn mon ic num phrase dum get l gg";
module.exports = {
networks: {
rinkeby: {
provider: function() {
return new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/"+mnemonic);
},
network_id: '*',
timeoutBlocks: 100000,
networkCheckTimeout:2000000
},
quorum: {
provider: function() {
return new HDWalletProvider(mnemonic, "http://127.0.0.1:21000/", chainId=10);
},
network_id: '*',
type: 'quorum',
timeoutBlocks: 100000,
networkCheckTimeout:2000000
},
compilers: {
solc: {
version: "0.5.0",
settings: {
optimizer: {
enabled: true, // Default: false
runs: 1000 // Default: 200
},
evmVersion: "homestead" // Default: "byzantium"
}
}
}
};
When I cd in to the directory with the truffle-config.js and I run truffle deploy --reset --network quorum to compile my smart contracts I get the following error.
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
/root/dapp1/Dapp/node_modules/web3-core-helpers/src/errors.js:42
return new Error(message);
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: Invalid JSON RPC response: ""
at Object.InvalidResponse (/root/dapp1/Dapp/node_modules/web3-core-helpers/src/errors.js:42:16)
at XMLHttpRequest.request.onreadystatechange (/root/dapp1/Dapp/node_modules/web3-providers-http/src/index.js:92:32)
at XMLHttpRequestEventTarget.dispatchEvent (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpRequestError (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:379:8)
at ClientRequest.<anonymous> (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:266:37)
at ClientRequest.emit (events.js:315:20)
at Socket.socketOnEnd (_http_client.js:493:9)
at Socket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
at PollingBlockTracker._performSync (/root/dapp1/Dapp/node_modules/eth-block-tracker/src/polling.js:51:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
I can deploy the smart contracts to rinkeby test net within this environment but I can't get smart contracts to deploy to quorum
I am using
Node v14.16.1
Ubuntu 18.04 (64 Bit)
Quorum 21.1.0
Web3.js v1.3.5
Truffle v5.3.4 (core: 5.3.4)
solidity v0.5.0
I've not used truffle with HDWalletProvider, which I believe is from an older version of Truffle. I'm not certain that will set up the node connection.
We would normally set up the configuration like the following in the quorum: {} section:
host: "localhost",
port: 22001,
type: "quorum"
I would suggest using that and see if it works.
Take a look at the truffle docs for working with quorum: https://www.trufflesuite.com/docs/truffle/distributed-ledger-support/working-with-quorum
Did you change from the default ports in the quorum-wizard?
The default for the node 1 RPC is 22000, the 21000 range is for p2p networking.
I would set the host and port per Satpal's answer above, as in the hdwallet documentation here.

Allocation failed - JavaScript heap out of memory

I am working on a project which is developing with NextJs and ReactJs. Suddenly this project showing Allocation failed - JavaScript heap out of memory problem. I have tried all the resources online but, those are not working for me. I think, maybe something error occurred in next.config.js or webpack but, I am not sure about it.
package.json
{
"name": "personal-blog",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"#fortawesome/fontawesome-svg-core": "^1.2.28",
"#fortawesome/free-brands-svg-icons": "^5.13.0",
"#fortawesome/free-regular-svg-icons": "^5.13.0",
"#fortawesome/free-solid-svg-icons": "^5.13.0",
"#fortawesome/react-fontawesome": "^0.1.9",
"bootstrap": "^4.4.1",
"dotenv": "^8.2.0",
"isomorphic-unfetch": "^3.0.0",
"moment": "^2.24.0",
"next": "9.3.5",
"node-fetch": "^2.6.0",
"react": "16.13.1",
"react-bootstrap": "^1.0.1",
"react-debounce-input": "^3.2.2",
"react-dom": "16.13.1",
"react-moment": "^0.9.7"
},
"devDependencies": {
"sass": "^1.26.5"
}
}
next.config.js
const webpack = require("webpack");
require("dotenv").config();
module.exports = {
webpack: config => {
config.node = {
fs: 'empty'
}
const env = Object.keys(process.env).reduce((acc, curr) => {
acc[`process.env.${curr}`] = JSON.stringify(process.env[curr]);
return acc;
}, {});
config.plugins.push(new webpack.DefinePlugin(env));
return config
}
}
Error in Visual Code terminal
<--- Last few GCs --->
[4562:0x103e3b000] 161295 ms: Mark-sweep 2041.6 (2051.3) -> 2040.7 (2051.3) MB, 3551.0 / 0.0 ms (average mu = 0.370, current mu = 0.462) allocation failure scavenge might not succeed
[4562:0x103e3b000] 170945 ms: Mark-sweep 2041.8 (2051.5) -> 2041.2 (2051.5) MB, 8225.9 / 0.2 ms (average mu = 0.253, current mu = 0.148) allocation failure GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x10072e699]
Security context: 0x3ecf281008a1 <JSObject>
1: createElement(aka createElement) [0x3ecf3bee16f9] [/Users/pater/Desktop/personal-blog/node_modules/react/cjs/react.development.js:~727] [pc=0x1d716fb9bc21](this=0x3ecfe42004a9 <undefined>,0x3ecffb609dc1 <String[#3]: div>,0x3ecfe4f40389 <Object map = 0x3ecfdd48e531>,0x3ecfe42004a9 <undefined>)
2: arguments adaptor frame: 2->3
3: createElement...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Writing Node.js report to file: report.20200424.120915.4562.0.001.json
Node.js report completed
1: 0x100b6a52a node::Abort() (.cold.1) [/usr/local/bin/node]
2: 0x100081f70 node::FatalError(char const*, char const*) [/usr/local/bin/node]
3: 0x100082098 node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
4: 0x10017461d v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0x1001745c7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
6: 0x10028a569 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
7: 0x10028b8ee v8::internal::Heap::MarkCompactPrologue() [/usr/local/bin/node]
8: 0x1002894eb v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
9: 0x100287f93 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
10: 0x10028f6da v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/local/bin/node]
11: 0x10028fbd0 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/local/bin/node]
12: 0x10026d8c6 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType) [/usr/local/bin/node]
13: 0x1004bc90e v8::internal::Runtime_AllocateInOldGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
14: 0x10072e699 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
15: 0x1d716fb9bc21
Abort

'deleteDb' is not exported by node_modules\idb\build\idb.js error when trying to import firebase to sapper project

I have stumbled across this article and tried proposed solution and it partialy worked for me.
Firebase loads fine, no error. idb doesn't load and 'npm run dev' throws me this error:
✗ client
'deleteDb' is not exported by node_modules\idb\build\idb.js
4: import { __values, __spread, __awaiter, __generator, __assign } from 'tslib';
5: import { ErrorFactory } from '#firebase/util';
6: import { deleteDb, openDb } from 'idb';
^
7:
8: /**
I have this in my rollup.config.js:
commonjs({
namedExports: {
// left-hand side can be an absolute path, a path
// relative to the current directory, or the name
// of a module in node_modules
'node_modules/idb/build/idb.js': ['deleteDb', 'openDb'],
'idb': ['deleteDb', 'openDb'],
'node_modules/firebase/dist/index.cjs.js': ['initializeApp', 'firestore', 'auth', 'analytics' ],
'node_modules/firebase/app/dist/index.esm.js': ['initializeApp', 'firestore', 'auth', 'analytics' ],
//'node_modules/firebase/app/dist/index.cjs.js': [],
//'node_modules/firebase/auth/dist/index.cjs.js': ['auth'],
//'node_modules/firebase/analytics/dist/index.cjs.js': ['analytics']
},
})
EDIT:
I've found out that reverting firebase from version 7.7.0 to 6.5.0 has solved this problem. Although this is not a fix I would want but will work for now.

Categories