Module.exports and es6 Import

React with babel. I have this confusion with imports and module.exports. I assume babel when converting the ES6 code to ES5 converts the imports and exports to require and module.exports...

How to import jquery using ES6 syntax?

I'm writing a new app using (JavaScript) ES6 syntax through babel transpiler and the preset-es2015 plugins, as well as semantic-ui for the style. index.js import * as stylesheet from...

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

NPM Start not starting local server

I am trying to make an react app using webpack and when I try to run npm start it should load http://localhost:3333 but it says site cannot be reached, here is my webpack config: module.exports =...

Error: Uncaught ReferenceError: React is not defined

Overview I am trying to use Babel and Webpack to build a React app. I know I could use create-react-app but I'd like to learn how these technologies can work together for myself. When I run yarn...

Why is "npm install" really slow?

What am I doing wrong when setting up my packages ? Is there any way to speed this up ? packages.json : { "name": "testing node", "version": "0.0.0", "description": "", "main":...

react router link to, inside map function, works only one time

I'have followed this react router example, but when I click a second time on another user, it seems that the User component state still unchanged. So, I can see just one user. package.json { ...

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

Electron failed to install correctly, please delete node_modules/ and try installing again

I am trying to use webpack + react + electron, and when I type in the CLI "electron ." it gives me this error: I deleted node_modules and re-installed all the modules over and over like about 6...

I am getting an "Invalid Host header" message when connecting to webpack-dev-server remotely

I am using as an environment, a Cloud9.io ubuntu VM Online IDE and I have reduced by troubleshooting this error to just running the app with Webpack dev server. I launch it...

"Only one instance of babel-polyfill is allowed" error

I need help diagnosing and fixing this error: "Error: only one instance of babel-polyfill is allowed" I have the following in my package.json: "devDependencies": { "babel-core": "^6.23.1", ...

How to output html files from pug templates with webpack?

I'm trying to output individual html files from pug templates in my webpack project. The problem I'm having is in getting pug-loader to render html into the files. My webpack.config: const path =...

using async/await with webpack-simple configuration throwing error: RegeneratorRuntime not defined

I am using webpack-simple template with following configurations: package.json { "name": "vue-wp-simple", "description": "A Vue.js project", "version": "1.0.0", "author": "v", ...

Docker build image - glob error { Error: EPERM: operation not permitted, scandir

I'm attempting to build a Docker image of a React+TypeScript+NodeJS application built with Webpack 2.0, but I get the following error > [email protected] build / > webpack -p --config...

how to configure Ant Design with Webpack 3

Fix and solution: Thanks to @BoyWithSilver, long story short, here are what I did to fix my problems: added .less into extensions section removed unnecessary codes in webpack.config.json e.g....

Preset files are not allowed to export objects

I have a carousel file in which I want to get index.js and build block.build.js, so my webpack.config.js is: var config = { entry: './index.js', output: { path: __dirname, filename:...

NPM cross-env not installed

I have the following package.json { "private": true, "scripts": { "dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules...

throw new TypeError('OAuth2Strategy requires a clientID option'); }

This is the error coming what to do.I have created a socket.io chat application. This is a chat application using nodejs.socket.io and with package.json as - Package.json "dependencies": { ...

npm install permission denied (macOS)

To install a Bootstrap theme I want to run npm install. However I always receive a permission denied error. I already tried nvm and then switched with nvm use 10.9.0 to run npm install. I also...

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

"ERROR command failed: npm install --loglevel error" when trying to do "vue create"

Vue CLI v3.2.1 ✨ Creating project in /home/mcaubrey511/portfolio. 🗃 Initializing git repository... ⚙ Installing CLI plugins. This might take a while... > [email protected] install...

vue-template-compiler/package.json missing module with every new project

Currently, I switched from linux to windows and started to create a programming environment. I don't remember similar problem on linux, but to the point: 1. Installed Node.js 2. npm install -g...

Create-React-App build - "Uncaught SyntaxError: Unexpected token <"

I realize this question has been asked multiple times but nothing has worked for me... I'm trying to create a static build of a create-react-app project but I'm getting the following...

Why is Babel 7 not compiling node_modules files?

I have error in IE11 SCRIPT1002: Syntax error (problem with class syntax). My simple code with 2 lines: import { struct } from 'superstruct'; console.log('finished'); I wan't that my babel7...

Module not found: Error: Can't resolve 'core-js/es6'

I've got a problem with my build process in relation to my React app. I always get the following error: Module not found: Error: Can't resolve 'core-js/es6' if I use this in a polyfill.js: import...

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

Module parse failed:.You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file."

I am facing the below error. I tried with all solutions mentioned in other post related to the same issue. But no luck. Please help. Error:- **ERROR in ./src/index.js 6:16 Module parse failed:...

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

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 CLI / Typescript based project no longer builds or runs Mocha tests

I have Vue 2 project scaffolded from Vue CLi that is throwing dozens of errors. It complies fine for developing but running unit tests or building for production it all goes wrong. Below is a...