Categories
Mastering Development

Webpack –watch no longer updating

Usually it’s sufficient to run npm run watch which in my case runs webpack –watch, however under no circumstances will it accept any of my updates today. I have deleted and rebuilt the dist folder, deleted and recloned/installed the entire repo (H5P Boilerplate), ensured my browser cache is clear (Chrome and Firefox), and restarted the […]

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

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

laravel error 1071 key was too long php artisan migrate

I am using Laravel and I have migration with function: public function up() { Schema::create(‘products’, function (Blueprint $table) { $table->increments(‘id’); $table->string(‘title’)->unique(); $table->string(‘slug’)->unique(); $table->string(‘subtitle’); $table->integer(‘price’); $table->text(‘description’); $table->boolean(‘featured’)->default(false); $table->timestamps(); }); } and when i do ‘php artisan migrate’ on my cmd i get error Migration table created successfully. Migrating: 2014_10_12_000000_create_users_table Illuminate\Database\QueryException SQLSTATE[42000]: Syntax error or access violation: […]

Categories
Mastering Development System & Network

Cannot migrate database on AWS Elastic Beanstalk

I have hosted a site in AWS. I have created a RDS DB instance for the elastic beanstalk. In my laravel app’s config/database.php file, I have configured my database connection as : ‘mysql’ => [ ‘driver’ => ‘mysql’, ‘host’ => ‘mydbidentefier.cdh7pykyg7in.ap-south-1.rds.amazonaws.com’, ‘port’ => 3306, ‘database’ => ‘mydbidentefier’, ‘username’ => ‘admin’, ‘password’ => ‘mypw’, ‘unix_socket’ => […]

Categories
Mastering Development

You may need an appropriate loader to handle this file type, currently no loaders are configured to process file

I just created a project using create-react-app (in javascript). In that, I am linking one of my other repository like this { "name": "hh-frontend-example", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", "hh-stylesheet": "file:../hh-stylesheet", "react": "^16.13.1", "react-dom": "^16.13.1", "react-scripts": "3.4.1" }, Here notice this line: "hh-stylesheet": "file:../hh-stylesheet", Now, When I start […]

Categories
Mastering Development

Property ‘toBeInTheDocument’ does not exist on type ‘Matchers

Trying to setup testing for a components library. I’ve tried many example and all similar threads on this with no luck. My setupTests.ts file is correctly being loaded (proven with a console.log), and the library seems to be available as if I add import { toBeInTheDocument } from ‘@testing-library/jest-dom/matchers’ and log toBeInTheDocument it is present. […]

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