Categories
Mastering Development

Cannot read property ‘fromJSON’ of undefined while testing in Jest

while running jest i get the following error.I dont know why am i getting this error. TypeError: Cannot read property ‘fromJSON’ of undefined at Object. (node_modules/@grpc/proto-loader/node_modules/protobufjs/ext/descriptor/index.js:3:66) at Object. (node_modules/@grpc/proto-loader/build/src/index.js:23:20) Below is the tsconfig.json { “compilerOptions”: { “target”: “esnext”, “module”: “commonjs”, “outDir”: “dist”, “sourceMap”: true, “moduleResolution”: “node”, “declaration”: true, “experimentalDecorators”: true, “allowSyntheticDefaultImports”: true, /* Allow default […]

Categories
Mastering Development Software

Mixing IoC container use with “poor mans” DI

I’m finding the use of IoC containers to be quite the shift in my application design, and its for the better. I’m using a framework called injector that aims to mimic (albeit not entirely) the Guice framework. With that in mind, I have 4 classes that I’d like to outline that show where my mixing […]

Categories
Mastering Development

TypeScript not finding variable declared in type declaration if I import a file

I made a very simple library which contains a .d.ts (source) which has the following structure (I omit the details because the file works fine, it likely is a config issue in my project): // Some helper types and interfaces type TranslationFunction = /* … */; export { TranslationFunction }; Then, I do npm i […]

Categories
CMS Development Magento

sales_order_save_after event not fired when creating an invoice

I like the event to be fired when we create an invoice for an order, to get order status complete etc/backend/events.xml <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Event/etc/events.xsd”> <!– new code Tarek –> <event name=”sales_order_save_after”> <observer name=”qbonline_syncOrder_completed” instance=”Vendor\Module\Observer\Order\Create”/> </event> </config> Vendor/Module/Observer/Order/Create.php namespace Vendor\Module\Observer\Order; use Magenest\QuickBooksOnline\Observer\AbstractObserver; use Magento\Framework\App\ObjectManager; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface as ObserverInterface; use Vendor\Module\Model\Synchronization\Order; use Magento\Framework\Message\ManagerInterface; use Vendor\Module\Model\Config; […]

Categories
Development

Hive table is not shown when using Sparklyr

I am trying to replicate this tutorial from RStudio website When I load the data into Hive, I can run show tables or select count(*) from airlines at the Hive command line and I will get the correct response. But later in the tutorial, when I install sparklyr and use the command below to connect […]

Categories
Development HTML

[SOLVED]Protobuf struct html chars

Okay my bad, something was broken in my dependencies. I have a strange situation. I’ve 1 gRPC Server and 1 HTTP server when HTTP Server gets GET request, it makes a call to gRPC server to fetch items from mongo. Here are my proto definitions: config item proto: import “google/protobuf/struct.proto”; // Config is the aggregator […]

Categories
Development

Why create-react-app alias is not able to find index.js from folder?

I am stuck up with a weird issue while creating alias for my app. I am trying to create the alias adding jsconfig.json what looks like { “compilerOptions”: { “lib”: [ “dom”, “es2015”, “es2016”, “es6”, “es2017” ], “target”: “es2017”, “module”: “es6”, “allowSyntheticDefaultImports”: true, “baseUrl”: “./”, “paths”: { “actions/*”: [“src/actions/*”], “public/*”: [“public/*”], “components/*”: [“src/components/*”], “containers/*”: [“src/containers/*”], […]

Categories
Ask

Open an url in javascript

UPDATE I am running this example : https://cloud.google.com/speech-to-text/docs/quickstart-client-libraries#client-libraries-install-nodejs in eclipse. It’s from the google cloud speech to text platform. It sends a request to transcribe an audio file to text. This works. Now I need to send the result as an whatsapp message. I know how to do this from the developer console in the […]