Why is the vanilla JS example for RxDB not working - javascript

I've followed the instructions at GitHub, but the example doesn't work.
The app shows "Starting database".
At the browser console there is this error:
Uncaught (in promise) TypeError: storage is undefined
_callee6$ http://127.0.0.1:20202/dist/rxdb.browserify.js:11032
tryCatch http://127.0.0.1:20202/dist/rxdb.browserify.js:70936
invoke http://127.0.0.1:20202/dist/rxdb.browserify.js:71167
defineIteratorMethods http://127.0.0.1:20202/dist/rxdb.browserify.js:70992
asyncGeneratorStep http://127.0.0.1:20202/dist/rxdb.browserify.js:14068
_next http://127.0.0.1:20202/dist/rxdb.browserify.js:14090
_asyncToGenerator http://127.0.0.1:20202/dist/rxdb.browserify.js:14097
_asyncToGenerator http://127.0.0.1:20202/dist/rxdb.browserify.js:14086
_createRxDatabaseStorageInstances http://127.0.0.1:20202/dist/rxdb.browserify.js:11060
createRxDatabaseStorageInstances http://127.0.0.1:20202/dist/rxdb.browserify.js:11017
_callee7$ http://127.0.0.1:20202/dist/rxdb.browserify.js:11075
tryCatch http://127.0.0.1:20202/dist/rxdb.browserify.js:70936
invoke http://127.0.0.1:20202/dist/rxdb.browserify.js:71167
defineIteratorMethods http://127.0.0.1:20202/dist/rxdb.browserify.js:70992
asyncGeneratorStep http://127.0.0.1:20202/dist/rxdb.browserify.js:14068
_next http://127.0.0.1:20202/dist/rxdb.browserify.js:14090
_asyncToGenerator http://127.0.0.1:20202/dist/rxdb.browserify.js:14097
_asyncToGenerator http://127.0.0.1:20202/dist/rxdb.browserify.js:14086
_prepare http://127.0.0.1:20202/dist/rxdb.browserify.js:11104
prepare http://127.0.0.1:20202/dist/rxdb.browserify.js:11064
createRxDatabase http://127.0.0.1:20202/dist/rxdb.browserify.js:11142
<anonymous> http://127.0.0.1:20202/main.js:33
When I try to add a hero and click the "Insert" button this error appears at the console:
Uncaught ReferenceError: col is not defined
addHero http://127.0.0.1:20202/main.js:97
onclick http://127.0.0.1:20202/:1
Ist this a bug or am I missing something?

According to the rxdb v10 release notes:
"...many (example projects) are outdated and need updates."
I was as well not able to get it working.

Related

Tests not running in Testcafe getting error 'TypeError: Cannot read property 'split' of undefined'

New to TestCafe .. just copied the code from their site and executed it.
import { Selector } from 'testcafe';
fixture `Getting Started`
.page `http://devexpress.github.io/testcafe/example`;
test('My first test', async t => {
await t
.typeText('#developer-name', 'John Smith')
.click('#submit-button');
});
The browsers are connected successfully but script is not executed and got error after some time
Nimits-MacBook-Pro:TestCafe nimit$ testcafe chrome demo.js
ERROR Was unable to open the browser "chrome:" due to error.
TypeError: Cannot read property 'split' of undefined
at Object.callee$0$0$ (/usr/local/lib/node_modules/testcafe/node_modules/testcafe-browser-tools/lib/api/find-window.js:111:36)
at tryCatch (/usr/local/lib/node_modules/testcafe/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:72:40)
at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/testcafe/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:334:22)
at Generator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/testcafe/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:105:21)
at tryCatch (/usr/local/lib/node_modules/testcafe/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:72:40)
at invoke (/usr/local/lib/node_modules/testcafe/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:146:20)
at /usr/local/lib/node_modules/testcafe/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:154:13
Environment
nodejs version - 10.16.0
npm - 6.9.0
OS - MACOS catalina
TestCafe - 1.6.0

Angular 4 - Unhandled Promise rejection: Object(...) is not a function ; Zone:

I don't know suddenly what happened but now I am facing some issue. Till the time app was working fine. But now whenever I am trying to run the app from android studio or xcode, I can see below error on chrome console. I did some research but not able to find anything. It would be great if someone could help me.
I am not using any kind of http service.
Current configuration of project-
1. ionic - v3
2. Angular - 4
3. Cordova
Unhandled Promise rejection: Object(...) is not a function ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Object(...) is not a function
at new ApplicationRef (vendor.js:5187)
at _createClass (vendor.js:8954)
at _createProviderInstance (vendor.js:8916)
at initNgModule (vendor.js:8849)
at new NgModuleRef_ (vendor.js:9575)
at createNgModuleRef (vendor.js:9564)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (vendor.js:11389)
at NgModuleFactory_.create (vendor.js:12091)
at vendor.js:4987
at t.invoke (polyfills.js:3) TypeError: Object(...) is not a function
at new ApplicationRef (file:///android_asset/www/build/vendor.js:5187:64)
at _createClass (file:///android_asset/www/build/vendor.js:8954:20)
at _createProviderInstance (file:///android_asset/www/build/vendor.js:8916:26)
at initNgModule (file:///android_asset/www/build/vendor.js:8849:32)
at new NgModuleRef_ (file:///android_asset/www/build/vendor.js:9575:9)
at createNgModuleRef (file:///android_asset/www/build/vendor.js:9564:12)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (file:///android_asset/www/build/vendor.js:11389:12)
at NgModuleFactory_.create (file:///android_asset/www/build/vendor.js:12091:25)
at file:///android_asset/www/build/vendor.js:4987:43
at t.invoke (file:///android_asset/www/build/polyfills.js:3:14976)

Why the following error when I deploy a function to firebase for realtime database

TypeError: Cannot read property 'val' of undefined
at exports.onDataAdded.functions.database.ref.onCreate.event (/user_code/index.js:5:28)
at Object. (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27)
at next (native)
at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71
at __awaiter (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:24:12)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:82:36)
at /var/tmp/worker/worker.js:710:26
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
This is my structure
The error was due to the uses of deprecated things.FCM has been updated from beta to 1.0.0. Now the difference can be seen in the following documentation-
https://firebase.google.com/docs/functions/beta-v1-diff#realtime-database

uncaught TypeError: Cannot read property 'substr' of undefined ionic

Suddenly im getting error when i start ionic project
TypeError: Cannot read property 'substr' of undefined
at Function.<anonymous> (D:\Work\Prince\TakeToTake\node_modules\source-map\lib\source-node.js:115:26)
at Array.forEach (native)
at BasicSourceMapConsumer.SourceMapConsumer_eachMapping [as eachMapping] (D:\Work\Prince\TakeToTake\node_modules\source-map\lib\sour
at Function.SourceNode_fromStringWithSourceMap [as fromStringWithSourceMap] (D:\Work\Prince\TakeToTake\node_modules\source-map\lib
at SourceMapSource.node (D:\Work\Prince\TakeToTake\node_modules\webpack-sources\lib\SourceMapSource.js:39:21)
at ReplaceSource.node (D:\Work\Prince\TakeToTake\node_modules\webpack-sources\lib\ReplaceSource.js:70:30)
at CachedSource.node (D:\Work\Prince\TakeToTake\node_modules\webpack-sources\lib\CachedSource.js:18:24)
at D:\Work\Prince\TakeToTake\node_modules\webpack-sources\lib\ConcatSource.js:37:50
at Array.map (native)
at ConcatSource.node (D:\Work\Prince\TakeToTake\node_modules\webpack-sources\lib\ConcatSource.js:36:63)
Please Help
Found the error
i was implement two Component inside one TS file that's why the nodeJS confuse to run which component
now i created another ts file to implement the component
thanks for the comments

Error with Humanizer.Js

I recently tried Humanizer.Js. I added a nuget reference of the same from here, and added it in my page as <script src="~/Scripts/humanizer/humanizer.js"></script>.
However in my page load I am getting an error:
"Uncaught TypeError: Cannot read property 'prototype' of undefined" at humanizer.js:409. The stack trace looks like below:
Uncaught TypeError: Cannot read property 'prototype' of undefined
__extends # humanizer.js:409
(anonymous function) # humanizer.js:416
Humanizer.Configuration.Humanizer.Configuration # humanizer.js:422
Humanizer # humanizer.js:424
(anonymous function) # humanizer.js:426
I have also created a plunk here to replicate the error. Also note that .humanize() also doesn't work.
Any suggestions?
I just released version 1.5 on NuGet, should fix your error

Categories

Resources