Categories
Mastering Development

Webpack 5 + Angular 11 Error: ./node_modules/msnodesqlv8/build/Release/sqlserverv8.node 1:2

I’m using Webpack 5 and Angular 11 when I execute the command ng build –prod && ng run test-app:server:production In the console it gives me an error message: Error: ./node_modules/msnodesqlv8/build/Release/sqlserverv8.node 1:2 Module parse failed: Unexpected character ‘�’ (1:2) You may need an appropriate loader to handle this file type, currently no loaders are configured to […]

Categories
Mastering Development

Cannot find ‘File’ type definitions Papaparse @types/papaparse

TS cannot find the File interface within the "@types/papaparse" module. I’d imagine that File is a Node type so I’m wondering if it’s maybe a TS setup issue. /node_modules/@types/papaparse/index.d.ts (23,25): Cannot find name ‘File’. /node_modules/@types/papaparse/index.d.ts (118,47): Cannot find name ‘File’. /node_modules/@types/papaparse/index.d.ts (119,38): Cannot find name ‘File’. /node_modules/@types/papaparse/index.d.ts /// <reference types="node" /> export as namespace Papa; […]

Categories
Mastering Development

‘ReactPlayer’ cannot be used as a JSX component

I attempt to use react-player for my React project. I’m using Typescript. I received the following error when I build it: ‘ReactPlayer’ cannot be used as a JSX component. Its instance type ‘ReactPlayer’ is not a valid JSX element. The types returned by ‘render()’ are incompatible between these types. Type ‘ReactNode’ is not assignable to […]

Categories
Mastering Development

CRA error – Cannot add property paths, object is not extensible

[debug: true] PS C:\data\test\todo> npm start > todo@0.1.0 start C:\data\test\todo > craco start craco: *** Cannot find ESLint loader (eslint-loader). *** Initial options: { "source": "tsconfig", "baseUrl": "./src", "tsConfigPath": "./tsconfig.extend.json", "debug": true } Normalized options: { "source": "tsconfig", "baseUrl": "./src", "tsConfigPath": "./tsconfig.extend.json", "debug": true } Aliases: { "@root": "C:\\data\\test\\todo\\src" } Webpack Config: { "react-native": "react-native-web", […]

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

Is it possible to configure wdio to make use of different tsconfig files?

I’m trying to get wdio setup to run our React TypeScript app. The problem is that it only works if I modify the tsconfig.json file itself to make use of the required types, change module to commonjs and set isolatedModules to false: { "compilerOptions": { "target": "es5", "lib": [ "dom", "dom.iterable", "esnext" ], "allowJs": true, […]

Categories
Mastering Development

Typescript Http.Post or Fetch in Express.js app

I’m new at Typescript and I’m trying to make an OAuth2 service like I’ve done in an Express.js normal app. But I’m not able to make a simple POST request with Typescript. All the examples I’ve found say I have to use "fetch", but when I do it I get an error saying fetch is […]

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 […]