Post Categories in default Keystone JS - content-management-system

I've been experimenting with Keystone CMS for the past week and I realised if you tagged your posts with categories that you've created in the post categories section, you'll get the following errors:
TypeError: Object #<Object> has no method 'each'
at Promise.<anonymous> (/Users/clippetmac/Sites/keystone/routes/views/blog.js:31:10)
at Promise.<anonymous> (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
at Promise.emit (events.js:95:17)
at Promise.emit (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
at Promise.fulfill (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:97:20)
at Promise.resolve (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/lib/promise.js:108:23)
at Promise.<anonymous> (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
at Promise.emit (events.js:95:17)
at Promise.emit (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
at Promise.fulfill (/Use rs/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:97:20)
at /Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/lib/query.js:1052:26
at model.Document.init (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/lib/document.js:250:11)
at completeMany (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/lib/query.js:1050:12)
at Object.cb (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/lib/query.js:1016:11)
at Object._onImmediate (/Users/clippetmac/Sites/keystone/node_modules/keystone/node_modules/mongoose/node_modules/mquery/lib/utils.js:137:16)
at processImmediate [as _immediateCallback] (timers.js:336:15)
Any Idea why?

The main issue here is that the async object that I've initialised does not have an "each" method.It turns out that I'm using an old async library that I've downloaded months ago. I installed the latest version of async and it worked like a charm.

Related

audio_service crashed with error at audio_service_engine

I uploaded a Flutter app on PlayStore and some cases was reported and the log is like below:
Exception java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3654)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3806)
at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2267)
at android.os.Handler.dispatchMessage (Handler.java:107)
at android.os.Looper.loop (Looper.java:237)
at android.app.ActivityThread.main (ActivityThread.java:8167)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100)
Caused by java.lang.IllegalStateException: The requested cached FlutterEngine did not exist in the FlutterEngineCache: 'audio_service_engine'
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine (FlutterActivityAndFragmentDelegate.java)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach (FlutterActivityAndFragmentDelegate.java)
at io.flutter.embedding.android.FlutterFragment.onAttach (FlutterFragment.java)
at androidx.fragment.app.Fragment.performAttach (Fragment.java)
at androidx.fragment.app.FragmentStateManager.attach (FragmentStateManager.java)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState (FragmentStateManager.java)
at androidx.fragment.app.FragmentStore.moveToExpectedState (FragmentStore.java)
at androidx.fragment.app.FragmentManager.moveToState (FragmentManager.java)
at androidx.fragment.app.FragmentManager.dispatchStateChange (FragmentManager.java)
at androidx.fragment.app.FragmentManager.dispatchCreate (FragmentManager.java)
at androidx.fragment.app.FragmentController.dispatchCreate (FragmentController.java)
at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java)
at io.flutter.embedding.android.FlutterFragmentActivity.onCreate (FlutterFragmentActivity.java)
at android.app.Activity.performCreate (Activity.java:7963)
at android.app.Activity.performCreate (Activity.java:7952)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3629)
I tried to google but it didn't give good result so I don't even know what is firstly wrong. what would be the problem?
See this bug report . If you're already using the latest version and it's not fixed, you will need to submit a new bug report to get it fixed. If you're not already using the latest version, then doing so will probably fix it.

Facebook sdk api subscribed_apps sudden failed with Invariant Violation in nuxt

I've used FB sdk with nuxt for a year now with this guide from:
How to use Facebook SDK with Nuxt.js?
I tried to use subscribed_apps api (this code works for an entire year, until today)
this.$fb.sdk.api(
`/${channel.page_id}/subscribed_apps`,
'POST',
{
'access_token': channel.page_token,
'subscribed_fields':
'messages, messaging_postbacks, messaging_optins, messaging_handovers, standby, message_echoes, feed, message_reads, messaging_referrals'
},
f
)
It suddenly failed with error:
Invariant Violation: Minified invariant #47458; %s Params: %s
at a (https://connect.facebook.net/en_US/sdk.js?hash=65b90259ffbe513d7eb4969d4ce7450f:67:366)
at Object._ (https://connect.facebook.net/en_US/sdk.js?hash=65b90259ffbe513d7eb4969d4ce7450f:102:180)
at Object.a [as execute] (https://connect.facebook.net/en_US/sdk.js?hash=65b90259ffbe513d7eb4969d4ce7450f:104:1337)
at u (https://connect.facebook.net/en_US/sdk.js?hash=65b90259ffbe513d7eb4969d4ce7450f:105:827)
at a.w [as graph] (https://connect.facebook.net/en_US/sdk.js?hash=65b90259ffbe513d7eb4969d4ce7450f:105:1606)
at Object.a [as api] (https://connect.facebook.net/en_US/sdk.js?hash=65b90259ffbe513d7eb4969d4ce7450f:108:1780)
at Object.<anonymous> (https://connect.facebook.net/en_US/sdk.js?hash=65b90259ffbe513d7eb4969d4ce7450f:73:838)
at Object.api (https://connect.facebook.net/en_US/sdk.js?hash=65b90259ffbe513d7eb4969d4ce7450f:63:260)
at VueComponent.connectFBChannel (webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vuetify-loader/lib/loader.js?!./node_modules/vue-loader/lib/index.js?!./components/settings/ConnectAndIntergraton.vue?vue&type=script&lang=js&:392:22)
at invokeWithErrorHandling (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:1853:26)
I checked sdk src from: https://connect.facebook.net/en_US/sdk.js
There's an update 7 days ago.
And I re-check the api descriptions about params, no update.
I have no clue to debug this at all.
p/s: one more thing, the login endpoint still work fine

ERROR Error: Uncaught (in promise): EmptyError: no elements in sequence vendor-es2015.js:43770

I'm developing my Ionic/Angular app, and I'm running into the following error when I try to log in through back-end login api. Any ideas as to why? I googled it, but I could find any relevant info, the issue still remains. What causes this error?
vendor-es2015.js:43770 ERROR Error: Uncaught (in promise): EmptyError: no elements in sequence
at resolvePromise (polyfills-es2015.js:4147)
at resolvePromise (polyfills-es2015.js:4104)
at polyfills-es2015.js:4208
at ZoneDelegate.invokeTask (polyfills-es2015.js:3741)
at Object.onInvokeTask (vendor-es2015.js:73623)
at ZoneDelegate.invokeTask (polyfills-es2015.js:3740)
at Zone.runTask (polyfills-es2015.js:3518)
at drainMicroTaskQueue (polyfills-es2015.js:3909)
at ZoneTask.invokeTask [as invoke] (polyfills-es2015.js:3819)
at invokeTask (polyfills-es2015.js:4953)
Finally, I found the cause of the issue. It's due to an error code returned by a back-end api call. After getting rid of the error code, the login functions well.

IBM Cloud App ID' s custom identity flow:InternalOAuthError occurs

I use IBM Cloud App ID' and I want to use LinkedIn as a provider.
However, "InternalOAuthError" occurs at the time of app approving.
There is a sample on the IBM Cloud blog.
Sign In Your App Users With Any Identity Provider Using App ID
I tried the sample app along this flow. Login to LinkedIn seems to have succeeded, but the following error occurred when app was approved.
InternalOAuthError: failed to fetch user profile
at _oauth2.get (C:\xxx\AppIdCustomIdentity\node_modules\passport-linkedin-oauth2\lib\oauth2.js:70:23)
at passBackControl (C:\xxx\AppIdCustomIdentity\node_modules\oauth\lib\oauth2.js:132:9)
at IncomingMessage.<anonymous> (C:\xxx\AppIdCustomIdentity\node_modules\oauth\lib\oauth2.js:157:7)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Please help!!
When I tried this post,"InternalOAuthError" no longer occurs.
But another error has occurred.
Error: Failed to obtain tokens
at Request.request [as _callback] (C:\xxx\AppIdCustomIdentity\node_modules\ibmcloud-appid\lib\token-manager\token-manager.js:118:13)
at Request.self.callback (C:\xxx\AppIdCustomIdentity\node_modules\request\request.js:185:22)
at Request.emit (events.js:182:13)
at Request.<anonymous> (C:\xxx\AppIdCustomIdentity\node_modules\request\request.js:1161:10)
at Request.emit (events.js:182:13)
at IncomingMessage.<anonymous> (C:\xxx\AppIdCustomIdentity\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
As suggested in this post (https://stackoverflow.com/a/56329029/10422503), looks like the passport-linkedin-oauth2 library has not been updated for the LinkedIn 2.0 APIs. Try using the fork suggested there
Looking at the stack trace it looks like the exception is coming from passport-linkedin-oauth2 module.
at _oauth2.get (C:\xxx\AppIdCustomIdentity\node_modules\passport-linkedin-oauth2\lib\oauth2.js:70:23)
Googling for InternalOAuthError: failed to fetch user profile +linkedin gives a few options you might want to try.

Meteor app crashes periodically with a Mongo error

Meteor app crashes every two-three minutes with this error:
TypeError: Error.captureStackTrace is not a function
at Error.MongoError (/Users/alex/.meteor/packages/npm-mongo/.1.5.45.1i7w6an++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/error.js:13:9)
at Function.MongoError.create (/Users/alex/.meteor/packages/npm-mongo/.1.5.45.1i7w6an++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/error.js:29:11)
at Socket.<anonymous> (/Users/alex/.meteor/packages/npm-mongo/.1.5.45.1i7w6an++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/connection/connection.js:161:20)
at Socket.g (events.js:260:16)
at emitNone (events.js:67:13)
at Socket.emit (events.js:166:7)
at Socket._onTimeout (net.js:332:8)
at _runOnTimeout (timers.js:524:11)
at _makeTimerTimeout (timers.js:515:3)
at Timer.unrefTimeout (timers.js:584:5)
This started after I updated my project to Meteor 1.4. Is Meteor doing something in the background? How can I debug it to find out what's going on?
Additional details: I'm using React, react-router and reactrouter:react-router-ssr. So there is server side rendering. Maybe this will trigger something...
Guys. The most important detail as I see it is this:
Error.captureStackTrace is not a function
This is a core node function! If I run node and enter Error I see the function: captureStackTrace: [Function: captureStackTrace]. So the issue looks like Meteor is maybe running an older version of node that doesn't have captureStackTrace in Error yet? Well, I followed the instructions here to check the version:
MonsterMac:/ alex$ cd ~/.meteor/packages/meteor-tool/1.4.0-1/mt-os.osx.x86_64/dev_bundle/bin/
MonsterMac:bin alex$ ./node -v
v4.4.7
According to the Change log captureStackTrace is there in version 4.4.7. Now what?
Meteor uses node 4.4.7. Also, with Meteor 1.4, Mongo is updated to a newer version. To resolve this error, try meteor reset. This will refresh Mongo to the latest version, when you start meteor next.