React Native jest keep throwing -TypeError: Component is not a function error

I am currently facing a problem while I am trying to add a simple unit test using jest. And it keeps throwing the TypeError:Component is not a function error and I cannot fix it. Anyone got the...

ES6 import for 'ava' test not working

I followed the docs to create my first test using ava but it doesn't seem to run properly. I get the error below. I tried adding import 'babel-register'; at the top of the file, and it works, but...

`regeneratorRuntime` is not defined when running Jest test

The title pretty much explains what I'm facing. I'm trying to test a React component that has some state, and I attempt to provide my store to the component in order to get what it needs. When I...

Set Electron favicon with electron-builder

I would like set new favicon in my Electron App and replace default Electron icon when my app is build. I use electron-builder package. In the doc, i see the icons need to be placed in the build...

npm run dev produces UnhandledPromiseRejectionWarning

I keep getting this error UnhandledPromiseRejectionWarning when I run npm run dev on my Vagrant machine and I can't figure out why or where to check where my promise ins't "completed" with catch()...

Webpack: TypeError: Cannot read property 'properties' of undefined

Here is the branch and repo in question: https://github.com/Futuratum/moon.holdings/tree/dev /Users/leongaban/projects/Futuratum/moon.holdings/node_modules/webpack-cli/bin/config-yargs.js:89 ...

Using babel-preset-react-app with @babel/register

I'm trying SSR with create-react-app without ejecting. In this repository, using react-app presets with changes like below fails. diff --git a/server/index.js b/server/index.js index...

Exported function is undefined

I'm facing an issue with my Mocha tests in Typescript, I fear it is related to Babel, but I am really not sure what's happening. Essentially, I have a function that is being exported in a file //...

“Error: Please install pg package manually” when trying to run “npm run serve:dev”?

I'm trying to run an app with script npm run serve:dev but it gives an error Error: Please install pg package manually when trying to run npm run serve:dev I already tried npm install -g pg','npm...

How to fix "ReferenceError: primordials is not defined" in Node.js

I have installed Node.js modules by 'npm install', and then I tried to do gulp sass-watch in a command prompt. After that, I got the below response. [18:18:32] Requiring external module...

How to call Vue components in my .cshtml pages?

I have a ASP.NET Core MVC project in conjunction with Vue.js. I am only using Vue.js to make my pages reactive. My goal is to create a main vue instance based on a div in the _layout.cshtml file...

How to use static imports in Glitch?

For the life of me, I can't understand how to use ES6 static imports in a simple Glitch.com project. I found this project where someone uses a static import with no extra node modules or anything...

Cannot get code coverage with Cypress + Istanbul

I tried setting up code coverage in an Angular 8 project using Cypress and istanbul nyc. I managed to get the code instrumented (the global variable __coverage__ is properly set) : and the...

Sass Loader Error: Invalid options object that does not match the API schema

I'm using VueJS with the framework [VuetifyJS][1] (v2.0.19). I'm getting this error after running npm run serve: Sass Loader has been initialised using an options object that does not match the...

how to optimise webpack bundle to split code into smaller files

I want to optimise the javascript pages being served. i am using webpack 4 and have the following configuration. i webpack using webpack -p --mode=production. when i webpack in production mode i...

NPM cannot find module 'date-fns/local/en-US' in react-date-range package

I've been using package react-date-range for some time now. After installing some other package, my app suddenly crashes with the following error message as I do npm start I have NO idea where...

React SSR error -- Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object

My app has a simple routing with ssr and below is my code ###index.tsx### import React from "react"; import ReactDOM from "react-dom"; import "./index.css"; import App from "./App"; import * as...

Using sequelize-cli in Node 14 with type: module

I'm trying to set up the project using Node v14.3 and sequelize. I don't want to use babel-register. Instead of this I set "type": "module" in my package.json and use all ES6 - ES11 features out...

unable to webpack to v5 from v4

I looked at the migrate guide https://webpack.js.org/migrate/5/ but its hard to understand what I need to change. the following is the error I get [webpack-cli] Invalid configuration object....

Error : Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found

I followed this tutorial https://medium.com/@ritikjain1272/making-drawer-navigator-and-a-splash-screen-on-your-react-native-app-2fb561ee17f1 And I have been able to work on several Mobile Apps in...

Typeorm production vs development - import statement outside a module

I have a project setup with NodeJS, typescript and TypeORM using ts-node-dev. Currently development works without issues, but when I try building it with babel and running it I have the following...

Why Eslint don't see global TypeScript types in .vue files (no-undef)

I have a global type in my Vue/TypeScript project. In the .ts files, everything is fine, and Eslint sees it, but in the .vue files, Eslint throws error that the type is not defined. TypeScript...

React with TypeScript using tsyringe for dependency injection

I am currently having trouble with my React TypeScript project. I created my project with npx create-react-app my-app --template typescript. I recently added tsyringe for dependency injection and...

Unable to get SHOP name

In the previous version I used to get the current shop name is like this: router.get("/api/app", async (ctx) => { let shop = ctx.session.shop; }); but, in the new version, i can't get the...

Tailwind error during build with vue project

My Vue2 Tailwind CSS project is running well in dev. But for production I still have an issue : cross-env NODE_ENV=production && npx tailwindcss -i ./src/assets/styles/index.css -o...

ReferenceError: require is not defined in ES module scope, you can use import instead gulp sass

I got an error when using this line of code const sass = require('gulp-sass')(require('sass')); The error output is : Requiring external module babel-register ReferenceError: require is not...

Migrating from Babel to SWC with React

TL;DR How to translate a node script like this: "test": "NODE_ENV=test riteway -r @babel/register 'src/**/*.test.js' | tap-nirvana", to use SWC instead of Babel? Context We recently upgraded our...

Attempted import error: 'withRouter' is not exported from 'react-router'

This is the code I am using for a register screen using React: import React, { useCallback } from "react"; import { withRouter } from "react-router"; import app from "../Firebase/firebase"; const...

npm ERESOLVE unable to resolve dependency tree NestJs Passport

I have following package.json { "dependencies": { "@elastic/elasticsearch": "^7.16.0", "@nestjs/common": "^8.2.4", "@nestjs/config": "^1.1.5", "@nestjs/core": "^8.2.4", ...

Error: Requiring module "node_modules\react-native-reanimated\src\Animated.js"

I am making an app in react native expo. It runs on web browser but fails to run on android simulator or expo go app on my phone. i get 2 errors :- Error: Requiring module...