Categories
Mastering Development

A type error in WorkBox routing when defining HeadersInit value

I’m currently trying to create a Service Worker with TypeScript and WorkBox. The following is my current WorkBox definition (just to get something going). How could I solve the type error that I explain the following? In the registerRoute piece TypeScript compiler tells that matchPrecache expect two parameters, the other being of type HeadersInit. If […]

Categories
Mastering Development

Unexpected token “export” using babel in docker container with docker-compose and typescript monorepo

I have been struggling with the following issue over the last couple days and can’t seem to track it down. I have a typescript monorepo with a shared package that I am trying to develop in docker using docker-compose. I can run them all directly from my local machine with yarn and everything boots up […]

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
Artificial Intelligence (AI) Development

Please debug my face recognition model

I wrote a script to do train a Siamese Network style model for face recognition on LFW dataset but the training loss doesnt decrease at all. Probably there’s a bug in my implementation. Could you please point it out. Right now my code does: Each epoch has 0.5M triplets all generated in an online way […]

Categories
Development

Nuxt.js SSR w/ Nest API deployed to AWS in a Docker container

I’ve tried roughly 5 million variations on the theme here, as well as spent a lot of time poring through the Nuxt docs and I cannot get Nuxt SSR with a Nest backend working when deployed in a docker container to AWS. Below is my current setup. Please let me know if I’ve left anything […]

Categories
Development

How can I use the Parcel bundler with the TSC

I’m currently trying to make a typescript game. I want to use Parcel as my bundler. But Parcel requires you to give one entry file. My current file structure is as followes builds -dev –public –private -production –public –private src -server -client tsconfig package.json vscode screenshot I want Parcel to output my client in the […]

Categories
Angular Development

Jest Unexpected identifier – Angular

I’m working on a jhipster generated angular project and when i try to run my tests im getting the following error … {import _ from ‘lodash’; SyntaxError: Unexpected identifier at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js … I’m very new to jest and related configurations needed. For what i can tell, jest is unable to deal with ES6 module […]

Categories
Development

Can’t use NextJs + ExpressJs with typescript and webpack

I want to setup ExpressJs with TypeScript to use IOC with InversifyJS and Nextjs with es6. I also want to use webpack to bundle. As i must import Next in server.ts to do serverside rendering so i setup typescript for nextjs too, but i want .js and .jsx file in client folder can has es6 […]