`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...

Why does Async Await work with React setState?

I have been using async await with babel in my ReactJS project. I discovered a convenient use with React setState that I would just like to understand better. Consider this code: handleChange =...

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()...

Cannot find module create-react-app/script/start.js

something has changed in my program structure and due to its complexity i cannot exactly point where the problem. Ever since my application crushed and no longer working i have tried different...

NPM | Error while installing modules

When I try to install some modules I get this error: npm ERR! Unexpected end of JSON input while parsing near '..."hjs":"~0.0.6","marke' npm ERR! A complete log of this run can be found in: npm...

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 ...

Babel ES-Lint parse errors in imported module. Cannot find module './parse-with-patch'

I have been searching Github and Stack Overflow for the past hour with no answer on how to fix this problem with ES-Lint. .eslintrc.json { "parser": "babel-eslint", "extends": ["airbnb",...

Unable to import soap-npm module with webpack 4 and babel 7

I've updated Webpack (v4.34.0) and Babel (v7.4.5) in an old Framework7 (v4.4.3) / Vue.js (v2.6.10) project. I need to use node-soap library as a soap client in my browser, but when run the code...

Module not found: Error: Can't resolve JSON

I've commanded npm run dev to run my code. However, it pops up several errors the first error it pops up is Module not found: Error: Can't resolve '../../build/contracts/User.json' I don't know...

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...

React/Typescript /VScode - an import path cannot end with a '.tsx' extension

I have a series of react projects which I have converted to typescript. Some of these use webpack, and some of them just use babel as they're libraries which are consumed by the other (webpack)...

Why is babel-loader not transforming object rest/spread?

I recently discovered in one of my projects that almost all of my JS code breaks in Edge 18 after the use of object rest/spread syntax. That was surprising to me as I expected that babel is...

How do I import pixi.js into a Svelte/Sapper app?

I'm new to Svelte and am trying to import pixi.js into my app. I've tried to import pixi.js into my svelte app following this post...

Jest won't transform the module - SyntaxError: Cannot use import statement outside a module

I couldn't get rid of this SyntaxError: Cannot use import statement outside a module error no matter what I have tried and it got so frustrating. Is there anybody out here solved this issue? I...

Jest encountered an unexpected token when testing a Vue single file component

I have a vue application with single file components and i want to add unit tests to test the components. I'm trying to use jest like described here but i keep getting the error "Jest encountered...

Webpack-Dev-Server: Errors while compiling. Reload prevented. (Stack: React)

I use React with Webpack-Dev-Server for local Development. Every now and then I get this error: "react_devtools_backend.js:6 [WDS] Errors while compiling. Reload prevented." After the error...

Jest Testing React Native cannot use import statement outside of a module

I have been trying to find out how to fix the following error when trying to run my Jest test using React Native: FAIL tests/App-test.js ● Test suite failed to...

After upgrading to vue 3 : "Cannot find module '@vue/compiler-sfc/package.json' "

After upgrading to vue 3 : yarn add [email protected] I get this error: "Cannot find module '@vue/compiler-sfc/package.json" when executing yarn electron:serve (base)...

Netlify "build.command" failed for gatsby website

I've recently updated some plugins on my Gatsby website. It works fine locally but it is failing the deploy on Netlify. The error I'm getting is: "build.command" failed - Command was killed with...

Jest + @testing-library/react throws error on a .mjs file from [dom-accessibility-api] library

I'm new to using Jest + @testing-library/react, and on my first attempt, I'm getting an error on a third-party library (probably used by the react-testing-library), which I'm not sure how to...

Babel can't resolve imports in it its own source code

I have upgraded a React project to Webpack 5. The aliases are resolved by Babel. Everything was working fine with Webpack 4. But when launching webpack dev server, Babel makes the build crash...

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....

"SyntaxError: Cannot use import statement outside a module" error while testing React Native project with Jest and @testing-library/react-native?

Error I'm getting Anytime I run npm test: FAIL ./App.test.js ● Test suite failed to run Jest encountered an unexpected token This usually means that you are trying to import a file which...

jest config is throwing "type ErrorHandler = (error: mixed, isFatal: boolean) => void" after update to 26.x

i don't know why this is suddenly not working but this is my jest.config.js: module.exports = { preset: 'react-native', verbose: true, moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx',...

Vue 2.6 not working correctly on Safari IOS

i have a button that when is clicked/pressed will trigger a click() on a input type=file and allow the user to upload a file, it works fine on every platform, but sometimes i need to make a...

CommonJS rollup plugin syntax error when importing 3rd party libraries, mostly related to 'process'

I've been working on a custom rollup config which takes a React project, and inlines the js and css in index.html. When I've imported some third party react libraries (like material-ui-color) I...

Babel 7 - Uncaught ReferenceError: regeneratorRuntime is not defined

I'm getting the error Uncaught ReferenceError: regeneratorRuntime is not defined using React with webpack and Babel . I've followed this answer by defining my .babel.rc as: { "presets":...

My routing with React router dom, <Route /> not working

I'm building a module federation/react aplication. I'm currently working on my container, and i've been setting up the environment for everything, including TS, now, when i try to create my...

Cannot use import statement outside a module in /node_modules

I'm in the process of migrating some node packages which has become quite a headache. Currently this is what my package.json looks like: { //These are the updated dependencies and Jest...

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", ...