Categories
Mastering Development

Chrome extension message passing not working (background.js to content.js)

I am at my wits end with trying to figure out why I can’t get message passing to work in my Chrome extension. Keep in mind, I am absolutely brand new to javascript within the last month and I’ve been teaching myself with videos online (my coding background is exclusively java). All I want is […]

Categories
Mastering Development

SASS Problem with npm scripts ( autoprefix and postcss )

My compilation process does not work and as I am a beginner I do not know why. Any constructive help is highly appreciated ;). I have spent like 24 hours to solve the problem without success… I have reinstalled all packages, cleaned cache etc., but nothing has helped. { "name": "natours", "version": "1.0.0", "description": "Landing […]

Categories
Mastering Development

TypeScript – error TS5023: Unknown compiler option ‘-r’

I’m working on Windows environment and trying to run a forked node.js + typescript project. This is my package.json : { "name": "my-task", "version": "1.0.0", "private": true, "main": "dist/main.js", "scripts": { "start": "tsc-watch –onSuccess ‘node -r source-map-support/register .’", "test": "jest", "lint": "eslint –cache ‘{src,test}/**/*.ts’" }, "dependencies": { "@types/express": "^4.17.7", "@types/node": "^12.12.53", "express": "^4.17.1", "get-port": "^5.1.1", […]

Categories
Mastering Development

How can I fix error code : ENOENT in node js?

When I make a post request to node server with /new route it throws an error code : ENOENT . This is the appjs file : const express = require(‘express’); const app = express(); const mongoose = require(‘mongoose’); const bodyParser = require(‘body-parser’); const cors = require(‘cors’); const port = process.env.PORT || 5000; const fs = […]

Categories
Mastering Development

dockerFile copy: Forbidden path outside the build context:

I have the following folder structure: – main/ .docker-compose.yml – backend/ – micro-hr/ .dockerfile – rabbitmq i have my micro-hr folder where is my main package and I have a local lib which is rabbitmq this is my dockerfile: FROM node:lts-alpine #create app directory #xx WORKDIR /usr/src RUN apk add –no-cache bash git RUN touch […]

Categories
Mastering Development

how to set response header in express

I am creating an express and reactJS app in which frontend and backend are on different url. In my app i want to work with cookies so for that i want to set response header Access-Control-Credentials to true. I have set it true but i still get this error. Access to fetch at ‘http://localhost:5000/login’ from […]

Categories
Mastering Development

Can’t use arrow function in ReactJs + Electron : Unexpected token

I used to use arrow function in Javascript in my React Native project and everything worked fine. Now, I’m working on a ReactJS App with Electron and I can’t do any arrow function. Here is an example : export default class App extends React.Component { constructor(props) { super(props); this.state = {nodes : [], path: ‘C:/Users/’, […]

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

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

Node-sass not compiling

Trying to make css files from scss with node-sass. My package.json: { "name": "hello-webpack", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "scss": "node-sass -watch scss -o css" }, "author": "", "license": "ISC", "devDependencies": { "sass": "^1.26.10", "sass-loader": "^9.0.3", "webpack": "^4.44.1", "webpack-cli": "^3.3.11" }, "dependencies": { […]