Categories
Mastering Development

How to configure stencil so that generated ts file doesnt come with double quotes

Right now whenever I ran command stencil build –docs, it will generate components.d.ts with below content /* eslint-disable */ /* tslint:disable */ /** * This is an autogenerated file created by the Stencil compiler. * It contains typing information for all components that exist in this project. */ import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; […]

Categories
Mastering Development

Type declaration error despite adding .d.ts file

I am using a npm package called update-immutable which happens to not have a typescript definition available built in or by @types. So I created a type definition file in my project and now VS Code detects the proper types for this package. However with noImplicitAny option set to true, Angular’s compiler doesn’t seem to […]

Categories
Mastering Development

How to enable @ experimentalDecorators in next.config.js or babelrc

Hi if someone would help me, I wanna use @Decorators on my nextjs app, but I get the following error. Hope someone knows what Im doin wrong Error message: Syntax error: Support for the experimental syntax ‘decorators-legacy’ isn’t currently enabled: I’m trying to use typeorm / type-graphql to generate my backend in an app subfolder. […]

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

Unable to load preload script – Electron.js Ubuntu 18.04.4

I’m trying to understand how to effectively load the proload.js file in electron: Version "electron": "^9.1.2", Version "electron-builder": "^22.8.0", In background.js I put webPreferences: { nodeIntegration: false, contextIsolation: true, //preload: path.join(app.getAppPath(), "preload.js"), preload: path.join(__dirname, "./preload.js"), }, preload.js and background.js are in the same folder: src folder. this is my preload.js : const { contextBridge, ipcRenderer […]

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

Angular9 application app selector html not loading with prod build

I have migrated my angular application from angular8 to 9. package.json { “name”: “visur”, “version”: “1.4.7-alpha.3”, “scripts”: { “ng”: “ng”, “start”: “ng serve”, “build”: “ng build”, “test”: “ng test”, “lint”: “ng lint”, “e2e”: “ng e2e” }, “private”: true, “dependencies”: { “@angular-devkit/build-webpack”: “^0.901.7”, “@angular/animations”: “~9.1.2”, “@angular/cdk”: “^9.0.0”, “@angular/common”: “~9.1.2”, “@angular/core”: “~9.1.2”, “@angular/flex-layout”: “9.0.0-beta.31”, “@angular/forms”: “~9.1.2”, “@angular/http”: […]

Categories
Mastering Development

Angular9 application app selector html not loading with prod build

I have migrated my angular application from angular8 to 9. package.json { “name”: “visur”, “version”: “1.4.7-alpha.3”, “scripts”: { “ng”: “ng”, “start”: “ng serve”, “build”: “ng build”, “test”: “ng test”, “lint”: “ng lint”, “e2e”: “ng e2e” }, “private”: true, “dependencies”: { “@angular-devkit/build-webpack”: “^0.901.7”, “@angular/animations”: “~9.1.2”, “@angular/cdk”: “^9.0.0”, “@angular/common”: “~9.1.2”, “@angular/core”: “~9.1.2”, “@angular/flex-layout”: “9.0.0-beta.31”, “@angular/forms”: “~9.1.2”, “@angular/http”: […]

Categories
Mastering Development

Angular9 application app selector html not loading with prod build

I have migrated my angular application from angular8 to 9. package.json { “name”: “visur”, “version”: “1.4.7-alpha.3”, “scripts”: { “ng”: “ng”, “start”: “ng serve”, “build”: “ng build”, “test”: “ng test”, “lint”: “ng lint”, “e2e”: “ng e2e” }, “private”: true, “dependencies”: { “@angular-devkit/build-webpack”: “^0.901.7”, “@angular/animations”: “~9.1.2”, “@angular/cdk”: “^9.0.0”, “@angular/common”: “~9.1.2”, “@angular/core”: “~9.1.2”, “@angular/flex-layout”: “9.0.0-beta.31”, “@angular/forms”: “~9.1.2”, “@angular/http”: […]

Categories
Mastering Development

Must I fix all TSLint errors before Angular production build?

I am able to run my Angular v8 app in development mode even there are TSlint TS errors (just showed few at below). However, when I try to build for production, it failed with npm ERR! code ELIFECYCLE npm ERR! errno 2. I have a number of TSlint TS errors, is there a way to […]