Hi I am working on a NodeJS project on Visual Studio 2019 using npm. When I build the app it fails with following error
Building for production... ERROR Failed to compile with 1 errors20:53:01 error in ./src/main.js Module build failed (from
./node_modules/thread-loader/dist/cjs.js): Thread Loader (Worker 0)
[BABEL] C:\Projects\xxx\RedAir\redAir\src\main.js: .overrides
is not allowed in preset options
at PoolWorker.fromErrorObj (C:\Projects\xx\RedAir\redAir\node_modules\thread-loader\dist\WorkerPool.js:262:12)
at C:\Projects\xx\RedAir\redAir\node_modules\thread-loader\dist\WorkerPool.js:204:29
at mapSeries (C:\Projects\xx\RedAir\redAir\node_modules\neo-async\async.js:3625:14)
at Object.keys.forEach.key (C:\Projects\xx\RedAir\redAir\node_modules#babel\core\lib\config\validation\options.js:71:13)
at Array.forEach ()
at validate (C:\Projects\xx\RedAir\redAir\node_modules#babel\core\lib\config\validation\options.js:69:21)
at instantiatePreset (C:\Projects\xx\RedAir\redAir\node_modules#babel\core\lib\config\full.js:242:36)
at cachedFunction (C:\Projects\xx\RedAir\redAir\node_modules#babel\core\lib\config\caching.js:42:19)
at loadPresetDescriptor (C:\Projects\xx\RedAir\redAir\node_modules#babel\core\lib\config\full.js:233:45)
at config.presets.map.descriptor (C:\Projects\xx\RedAir\redAir\node_modules#babel\core\lib\config\full.js:68:19)
at Array.map ()
at recurseDescriptors (C:\Projects\xx\RedAir\redAir\node_modules#babel\core\lib\config\full.js:66:38)
at loadFullConfig (C:\Projects\xx\RedAir\redAir\node_modules#babel\core\lib\config\full.js:106:6)
# multi ./src/main.js ERROR Build failed with errors.
Here is my main.js
import Vue from 'vue';
import App from './App.vue';
Vue.config.productionTip = true;
new Vue({
render: h => h(App)
}).$mount('#app');
Here is Package.json
{
"author": {
"name": "HaBo"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"dependencies": {
"#babel/runtime-corejs3": "^7.7.4",
"#capacitor/core": "^1.3.0",
"#fortawesome/fontawesome-svg-core": "^1.2.25",
"#fortawesome/free-solid-svg-icons": "^5.11.2",
"#fortawesome/vue-fontawesome": "^0.1.8",
"#ionic/core": "^4.11.5",
"#ionic/vue": "0.0.4",
"#openlayers/pepjs": "^0.5.3",
"#sentry/browser": "^5.9.1",
"#sentry/core": "^5.8.0",
"#sentry/hub": "^5.8.0",
"#sentry/integrations": "^5.8.0",
"#sentry/minimal": "^5.8.0",
"#sentry/types": "^5.7.1",
"#sentry/utils": "^5.8.0",
"#vue/babel-preset-app": "^4.1.1",
"amazon-cognito-identity-js": "^3.2.0",
"amazon-cognito-js": "^1.1.0",
"aws-sdk": "^2.581.0",
"axios": "^0.19.0",
"axios-extensions": "^3.0.6",
"base64-js": "^1.3.1",
"buffer": "^5.4.3",
"core-js": "^3.4.5",
"core-js-pure": "^3.4.5",
"crypto-js": "^3.1.9-1",
"d3": "^5.14.2",
"d3-array": "^2.4.0",
"d3-axis": "^1.0.12",
"d3-brush": "^1.1.5",
"d3-chord": "^1.0.6",
"d3-collection": "^1.0.7",
"d3-color": "^1.4.0",
"d3-contour": "^1.3.2",
"d3-dispatch": "^1.0.6",
"d3-drag": "^1.2.5",
"d3-dsv": "^1.2.0",
"d3-ease": "^1.0.6",
"d3-fetch": "^1.1.2",
"d3-force": "^2.0.1",
"d3-format": "^1.4.2",
"d3-geo": "^1.11.9",
"d3-hierarchy": "^1.1.9",
"d3-interpolate": "^1.4.0",
"d3-path": "^1.0.9",
"d3-polygon": "^1.0.6",
"d3-quadtree": "^1.0.7",
"d3-random": "^2.0.1",
"d3-scale": "^3.2.1",
"d3-scale-chromatic": "^1.5.0",
"d3-selection": "^1.4.1",
"d3-shape": "^1.3.7",
"d3-time": "^1.1.0",
"d3-time-format": "^2.2.2",
"d3-timer": "^1.0.10",
"d3-tip": "^0.9.1",
"d3-transition": "^1.3.2",
"d3-voronoi": "^1.1.4",
"d3-zoom": "^1.8.3",
"dom7": "^2.1.3",
"ieee754": "^1.1.13",
"inherits": "^2.0.4",
"ionicons": "^4.6.3",
"is-buffer": "^2.0.4",
"isarray": "^2.0.5",
"jmespath": "^0.15.0",
"js-cookie": "^2.2.1",
"leaflet": "^1.6.0",
"leaflet-arc": "^1.0.2",
"leaflet-easybutton": "^2.4.0",
"line-clamp": "^1.0.0",
"lru-cache": "^5.1.1",
"moment": "^2.24.0",
"moment-timezone": "^0.5.27",
"node-libs-browser": "^2.2.1",
"ol": "^6.1.1",
"olcs": "^2.10.0",
"path-browserify": "^1.0.0",
"pseudomap": "^1.0.2",
"q": "^1.5.1",
"querystring-es3": "^0.2.1",
"rbush": "^3.0.1",
"regenerator-runtime": "^0.13.3",
"secure-ls": "^1.2.5",
"ssr-window": "^1.0.1",
"swiper": "^5.2.1",
"thread-loader": "^2.1.3",
"three": "^0.111.0",
"tslib": "^1.10.0",
"underscore": "^1.9.1",
"util": "^0.12.1",
"uuid": "^3.3.3",
"vue-loader": "^15.7.2",
"vue-router": "^3.1.3",
"vue-tour": "^1.1.0",
"wicket": "^1.3.5",
"yallist": "^4.0.0"
},
"description": "redAir",
"devDependencies": {
"#vue/cli-plugin-babel": "3.0.4",
"#vue/cli-plugin-eslint": "3.0.4",
"#vue/cli-service": "3.0.4",
"eslint": "5.6.0",
"eslint-plugin-vue": "4.7.1",
"vue": "^2.6.10",
"vue-template-compiler": "2.5.17"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
},
"name": "red-air",
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"version": "0.1.0"
}
How do I overcome this issue and build it successfully?
Related
every time I try to launch the generate for my nuxt project on gitlab, I get back for every page generated a strange error,
[error] /Dashboard
TypeError: external_defu_ is not a function
at server.js:12669:45
at Array.reduce (<anonymous>)
at new runtime_BaseScheme (node_modules/#nuxtjs/auth-next/dist/runtime.mjs:883:0)
at new runtime_Oauth2Scheme (node_modules/#nuxtjs/auth-next/dist/runtime.mjs:1137:0)
at auth (node_modules/.cache/nuxt/auth.js:45:0)
at createApp (node_modules/.cache/nuxt/index.js:291:0)
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:526:9)
at processTimers (node:internal/timers:500:7)
at async module.exports.__webpack_exports__.default (node_modules/.cache/nuxt/server.js:85:0)
This prevents the page from generating itself correctly.
While if I launch the project locally, with the same version of node, it generates everything correctly.
Do you know how I can solve the problem?
In gitlab's docker I'm using node v12.16.3.
This is my package.json
{
"name": "xxx",
"version": "1.0.0",
"description": "xxx",
"author": "Alessandro",
"private": true,
"scripts": {
"generate": "ENV=production nuxt generate",
generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore ."
},
"dependencies": {
"#nuxtjs/auth": "^4.9.1",
"#nuxtjs/auth-next": "5.0.0-1613647907.37b1156",
"#nuxtjs/axios": "^5.13.1",
"#nuxtjs/pwa": "^3.3.4",
"#vue/composition-api": "^0.6.7",
"aws-sdk": "^2.610.0",
"axios": "^0.21.1",
"bcryptjs": "^2.4.3",
"browser-image-compression": "^1.0.14",
"caniuse-lite": "^1.0.30001257",
"chart.js": "^2.9.3",
"child_process": "^1.0.2",
"compass": "^0.1.1",
"cookie": "^0.4.0",
"cookie-universal-nuxt": "^2.1.4",
"cors": "^2.8.5",
"cross-fetch": "^3.1.5",
"file-saver": "^2.0.2",
"fs": "0.0.1-security",
"gapi-script": "^1.2.0",
"install": "^0.13.0",
"js-cookie": "^2.2.1",
"kaleidoscopejs": "1.0.18",
"leaflet": "^1.6.0",
"lodash": "^4.17.15",
"md5": "^2.2.1",
"moment": "^2.29.3",
"multer": "^1.4.2",
"net": "^1.0.2",
"node-fetch": "^2.6.7",
"node-orientdb-http": "^0.1.1",
"npm": "^8.13.1",
"nuxt": "^2.15.0",
"nuxt-gmaps": "^1.2.10",
"nuxt-i18n": "^6.3.0",
"nuxt-leaflet": "0.0.19",
"nuxt-sass-resources-loader": "^2.0.5",
"p-iteration": "^1.1.8",
"pannellum": "github:saidmoya12/pannellum",
"panolens": "^0.12.1",
"proxy": "^1.0.2",
"readline": "^1.3.0",
"simple-analytics-vue": "^1.1.5",
"tls": "0.0.1",
"videojs": "^1.0.0",
"videojs-panorama": "^0.1.7",
"vue": "2.6.14",
"vue-chartjs": "^3.5.0",
"vue-cookie-accept-decline": "^5.3.1",
"vue-expandable-image": "^0.1.0",
"vue-google-login": "^2.0.3",
"vue-pannellum": "^0.5.3",
"vue-plausible": "^1.2.1",
"vue-rangedate-picker": "^1.0.0",
"vue-rangedate-picker-winslow": "^1.0.8",
"vue-server-renderer": "^2.6.12",
"vue-template-compiler": "^2.6.12",
"vue-tooltipster": "^1.2.0",
"vue-upload-multiple-image": "^1.1.4",
"vue2-google-maps": "^0.10.7",
"vue2-leaflet": "^2.6.0",
"vuedraggable": "^2.23.2",
"vuejs-panorama": "^1.1.9",
"vuejs-vr": "^1.2.2",
"vuetify": "^2.5.12",
"vuex-persistedstate": "^3.0.1",
"webpack": "^4.45.0"
},
"devDependencies": {
"#aceforth/nuxt-optimized-images": "^1.4.0",
"#nuxt/bridge": "npm:#nuxt/bridge-edge#^3.0.0-27268729.5b8e10f",
"#nuxt/image": "^0.7.1",
"#nuxt/types": "^2.14.12",
"#nuxtjs/dotenv": "^1.4.1",
"#nuxtjs/eslint-config": "^3.1.0",
"#nuxtjs/eslint-module": "^2.0.0",
"#nuxtjs/google-analytics": "^2.4.0",
"#nuxtjs/vuetify": "^1.12.3",
"babel-eslint": "^10.0.1",
"eslint": "^7.5.0",
"eslint-plugin-nuxt": ">=0.4.2",
"imagemin-gifsicle": "^7.0.0",
"imagemin-mozjpeg": "^9.0.0",
"imagemin-pngquant": "^9.0.2",
"imagemin-svgo": "^9.0.0",
"lqip-loader": "^2.2.1",
"responsive-loader": "^2.3.0",
"rimraf": "^3.0.2",
"sharp": "^0.30.7",
"sqip-loader": "^1.0.0",
"webp-loader": "^0.6.0"
}
}
Thank you very much
Alessandro
I also had this issue on Nuxt2 Bridge using #nuxtjs/auth-next. The solution is to transpile defu during the build:
nuxt.config.js
export default defineNuxtConfig({
// ...
build: {
transpile: [
'defu',
],
},
})
The issue and possible solutions are described in the docs: https://v3.nuxtjs.org/guide/going-further/esm/
When I do npm link like this in Window 10:
L:\git\notistack> npm link L:\react\Greta100Weeks\greta100weeks\node_modules\react
In my app when I do import { useSnackbar } from 'notistack'; then I can use the notistack ok, and it's the global notistack. I want to modify it debug it locally so I forked it and did the npm link but when I npm start the the App get the "You might have more than one copy of React in the same app " error. I also test this and it's true so that's why I do the npm link react and it's also recommended so I don't know what I do wrong here
To be able to debug notistack in VSCode and use the notistack in my app in VSCode. I do npm link. I get the Duplicate React error so must npm link the App react version and tell notistack to us the app react.
But I get this error: I do this npm link on other library's without problem but now this error:
I have tried to fixed this but it's not working.
I also do:
L:\git\notistack> npm link L:\react\Greta100Weeks\greta100weeks\node_modules\react-dom
And that is resolving ok.
I fork the notistack library and is using it ok in the app but only when I do npm link it fails. What is the problem here I guess it's in the package.json
Here is the package.json for the forked library notistack:
{
"name": "notistack",
"version": "1.0.10",
"description": "Highly customizable notification snackbars (toasts) that can be stacked on top of each other",
"main": "dist/index.js",
"module": "dist/notistack.esm.js",
"types": "dist/index.d.ts",
"license": "MIT",
"author": {
"name": "Hossein Dehnokhalaji",
"email": "hossein.dehnavi98#yahoo.com",
"url": "https://github.com/iamhosseindhv/notistack"
},
"homepage": "https://www.iamhosseindhv.com/notistack",
"repository": {
"url": "git+https://github.com/iamhosseindhv/notistack.git",
"type": "git"
},
"scripts": {
"build": "tsdx build --transpileOnly --entry ./src/index.js",
"prebuild": "npm run docs",
"prepublishOnly": "npm run build",
"docs": "rimraf typedoc.json && typedoc --tsconfig",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"peerDependencies": {
"#material-ui/core": "^4.11.2",
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"devDependencies": {
"#babel/preset-react": "^7.8.3",
"#material-ui/core": "^4.9.5",
"#types/node": "^13.9.0",
"#types/react": "^16.9.23",
"#types/react-dom": "^16.9.5",
"#types/react-is": "^16.7.1",
"#typescript-eslint/eslint-plugin": "^3.9.1",
"#typescript-eslint/parser": "^3.9.1",
"babel-plugin-optimize-clsx": "^2.6.1",
"eslint": "^7.7.0",
"eslint-config-airbnb": "~18.2.0",
"eslint-plugin-import": "~2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.6",
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0",
"rimraf": "^3.0.2",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-copy": "^3.3.0",
"tsdx": "^0.13.2",
"typedoc": "^0.16.11",
"typescript": "^3.8.3"
},
"dependencies": {
"clsx": "^1.1.0",
"hoist-non-react-statics": "^3.3.0"
},
"bugs": {
"url": "https://github.com/iamhosseindhv/notistack/issues"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/notistack"
},
"contributors": [
"Hossein Dehnokhalaji (https://www.iamhosseindhv.com/)"
],
"keywords": [
"notistack",
"enqueueSnackbar",
"snackbarprovider",
"useSnackbar",
"multiple",
"react",
"javascript",
"material-ui",
"toast",
"redux",
"snackbar",
"stacked",
"notification",
"material design",
"hossein",
"dehnokhalaji",
"iamhosseindhv"
]
}
Here is the package.json for the app using the library:
{
"name": "greta-thunberg-fff",
"version": "1.2.9",
"private": true,
"homepage": "https://greta.portplays.com",
"main": "index.js",
"module": "dist/index.js",
"files": [
"dist",
"README.md"
],
"dependencies": {
"#material-ui/core": "^4.11.2",
"#material-ui/icons": "^4.11.2",
"#material-ui/lab": "^4.0.0-alpha.57",
"#material-ui/styles": "^4.11.2",
"axios": "^0.19.2",
"bootstrap": "^4.5.2",
"change-case": "^4.1.2",
"classnames": "^2.3.1",
"clean-tag": "^3.1.1",
"clsx": "^1.1.1",
"comma-separated-values": "^3.6.4",
"crypto-js": "^4.0.0",
"date-fns": "^2.23.0",
"faker": "^5.5.3",
"firebase": "^7.23.0",
"formik": "^2.2.5",
"framer-motion": "^2.9.5",
"gsap": "^3.5.1",
"history": "^5.0.0",
"i": "^0.3.6",
"lodash": "^4.17.19",
"lodash.debounce": "^4.0.8",
"mammoth": "^1.4.11",
"material-table": "^1.69.2",
"moment": "^2.27.0",
"normalize-wheel": "^1.0.1",
"notistack": "^1.0.10",
"npm": "^7.11.2",
"pdfjs-dist": "^1.8.357",
"preval.macro": "^5.0.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-activity": "^1.2.2",
"react-bootstrap": "^1.3.0",
"react-chartjs-2": "^2.11.1",
"react-data-grid": "^6.1.0",
"react-detect-offline": "^2.4.0",
"react-dom": "^17.0.2",
"react-dropzone": "^11.3.4",
"react-helmet": "^6.1.0",
"react-motion": "^0.5.2",
"react-perfect-scrollbar": "^1.5.8",
"react-redux": "^7.2.5",
"react-resize-detector": "^5.0.7",
"react-router": "^6.0.0-beta.4",
"react-router-dom": "^6.0.0-beta.4",
"react-scripts": "^3.4.0",
"react-slick": "^0.27.3",
"react-spring": "^8.0.27",
"react-transition-group": "^4.4.1",
"react-visibility-sensor": "^5.1.1",
"rebass": "^4.0.7",
"recompose": "^0.30.0",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
"redux-saga": "^1.1.3",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"sass": "^1.41.1",
"simplebar-react": "^2.3.5",
"slick-carousel": "^1.8.1",
"styled-components": "^5.1.1",
"styled-system": "^5.1.5",
"three": "^0.85.2",
"typescript": "^3.9.7",
"uuid": "^8.3.1",
"xlsx": "^0.10.1",
"yup": "^0.32.1"
},
"scripts": {
"start": "set PORT=6545&& react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -b master -d build"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"#typescript-eslint/eslint-plugin": "^4.1.1",
"#typescript-eslint/parser": "^4.1.1",
"axios": "^0.19.2",
"babel-eslint": "^10.1.0",
"clean-tag": "^3.1.1",
"eslint": "^6.6.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"gh-pages": "^2.0.1",
"prettier": "^2.1.1",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-scripts": "^3.4.3",
"rebass": "^4.0.7",
"styled-system": "^5.1.5"
}
}
I have a Vue application which is running live and node version is 8. I have clone this application, I deleted the package.lock file and node_module folder, and run npm i, I have node 12.18 installed on my mechine, after successful installation, I try to run appplication by npm run dev, but getting error:
ERROR Failed to compile with 1 errors 11:14:59 AM
error in ./node_modules/pdfjs-dist/build/pdf.worker.js
Module build failed: Error: Cannot find module 'webpack/lib/web/FetchCompileWasmTemplatePlugin'
Require stack:
- C:\xampp\htdocs\easy-portal\node_modules\worker-loader\dist\index.js
- C:\xampp\htdocs\easy-portal\node_modules\worker-loader\dist\cjs.js
- C:\xampp\htdocs\easy-portal\node_modules\loader-runner\lib\loadLoader.js
- C:\xampp\htdocs\easy-portal\node_modules\loader-runner\lib\LoaderRunner.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack\lib\NormalModule.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack\lib\NormalModuleFactory.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack\lib\Compiler.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack\lib\webpack.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack-dev-server\lib\Server.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack-dev-server\bin\webpack-dev-server.js
here is my package.json file:
{
"name": "app",
"version": "1.0.0",
"description": "ATS System",
"author": "N4TECH",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "node server.js",
"build:dev": "node build/dev.js",
"build:prod": "node build/build.js"
},
"dependencies": {
"axios": "^0.17.1",
"bootstrap": "^3.3.7",
"bootstrap-vue": "^1.4.0",
"chalk": "^2.0.1",
"css-loader": "^0.28.8",
"debounce": "^1.1.0",
"express": "^4.16.3",
"express-static-gzip": "^0.3.2",
"jquery": "^3.3.1",
"lodash": "^4.17.5",
"moment": "^2.20.1",
"node-sass": "^4.7.2",
"pusher-js": "^4.3.1",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.6",
"tributejs": "^3.5.3",
"vee-validate": "^2.0.0-beta.17",
"vue": "^2.5.2",
"vue-clipboard2": "^0.3.1",
"vue-html5-editor": "^1.1.1",
"vue-i18n": "^8.1.0",
"vue-pdf": "^3.2.0",
"vue-router": "^3.0.1",
"vue-scrollto": "^2.11.0",
"vue-social-sharing": "^2.3.3",
"vue-style-loader": "^3.0.3",
"vue-truncate-collapsed": "^1.3.0",
"vue2-datatable-component": "^2.1.26",
"vuedraggable": "^2.16.0",
"vuetify": "^1.2.4",
"vuex": "^3.0.1",
"vuex-persistedstate": "^2.4.2"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"compression-webpack-plugin": "^1.1.6",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0",
"worker-loader": "^3.0.7"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
Any help would be highly appreciable.
I fixed it by update webpack to webpack5
I tried to run the command meteor build --directory . to build a bundle directory for the meteor app then I got errors like as follows:
Errors prevented bundling:
While processing files with ecmascript (for target web.browser):
/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/
#babel/core/lib/config/validation/option-assertions.js:146:13:
[BABEL] bundle/programs/web.browser/app/scripts/vendor/modernizr.js: .plugins[0] may only be a two-tuple or three-tuple
at assertPluginItem
(/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules
/#babel/core/lib/config/validation/option-assertions.js:146:13)
at
/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/
#babel/core/lib/config/validation/option-assertions.js:132:14
at Array.forEach (<anonymous>)
at assertPluginList
(/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules
/#babel/core/lib/config/validation/option-assertions.js:131:9)
at
/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/
#babel/core/lib/config/validation/options.js:83:20
at Array.forEach (<anonymous>)
at validate
(/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules
/#babel/core/lib/config/validation/options.js:61:21)
at
/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/
#babel/core/lib/config/index.js:246:36
at cachedFunction
(/home/takhi_abed/.meteor/packages/ecmascript/.0.10.2.113xul7.mfme++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules
/#babel/core/lib/config/caching.js:40:17)
at loadPresetDescriptor...and more lines like these. I looked into some issues on stackoverflow and github and found some commands like meteor npm install --save babel-runtime and tried them but still the same errors show up. It would be great if someone can help.
Here is the .babelrc file:
```
{
"presets": [
],
"plugins": [
[
"transform-class-properties",
"babel-plugin-inline-import",
"babel-plugin-inline-import-graphql-ast",
{
"extensions": [
".graphqls",
".graphql"
]
}
]
]
}```
and here is package.json file:
```{
"name": "enliven-frontend",
"version": "1.8.9",
"engines": {
"npm": "^3.0"
},
"scripts": {
"prestart": "sh prestart_vulcan.sh",
"start": "meteor --settings settings-development.json",
"start-the-show": "meteor --settings settings-production.json",
"lint": "eslint --cache --ext .jsx,js packages"
},
"dependencies": {
"#babel/runtime": "^7.0.0-beta.55",
"analytics-node": "^2.4.1",
"apollo-client": "^1.9.1",
"apollo-engine": "^0.5.4",
"apollo-errors": "^1.4.0",
"apollo-server-express": "^1.3.2",
"bcrypt": "^1.0.3",
"body-parser": "^1.18.2",
"chalk": "2.2.0",
"classnames": "^2.2.5",
"cloudflare": "^2.4.1",
"compression": "^1.7.1",
"cookie-parser": "^1.4.3",
"cross-fetch": "^0.0.8",
"crypto-js": "^3.1.9-1",
"dataloader": "^1.3.0",
"deepmerge": "^1.5.0",
"escape-string-regexp": "^1.0.5",
"express": "^4.15.4",
"flat": "^4.0.0",
"formsy-react": "^0.19.5",
"formsy-react-components": "^0.11.1",
"graphql": "^0.10.5",
"graphql-anywhere": "^3.0.1",
"graphql-date": "^1.0.2",
"graphql-tag": "^2.0.0",
"graphql-tools": "^2.19.0",
"graphql-type-json": "^0.1.4",
"handlebars": "^4.0.10",
"he": "^1.1.1",
"history": "^3.3.0",
"html-to-text": "^2.1.3",
"immutability-helper": "^2.3.1",
"import": "0.0.6",
"install": "^0.10.1",
"intl": "^1.2.5",
"intl-locales-supported": "^1.0.0",
"isomorphic-fetch": "^2.2.1",
"json-path": "^0.1.3",
"juice": "^1.11.0",
"lodash": "^4.17.5",
"mailchimp": "^1.2.0",
"marked": "^0.3.9",
"metascraper": "^1.0.7",
"meteor-node-stubs": "^0.3.2",
"mingo": "^0.8.1",
"moment": "^2.18.1",
"new-relic-agent-react": "^2.0.1",
"optics-agent": "^1.1.6",
"photoswipe": "^4.1.2",
"prop-types": "^15.5.10",
"rangy": "^1.3.0",
"react": "^16.2.0",
"react-addons-pure-render-mixin": "^15.6.0",
"react-apollo": "^1.4.15",
"react-bootstrap": "^0.32.0",
"react-bootstrap-datetimepicker": "0.0.22",
"react-cookie": "^0.4.9",
"react-country-region-selector": "^1.1.0",
"react-datetime": "^2.11.1",
"react-dfp": "^0.7.5",
"react-dom": "^16.2.0",
"react-dropzone": "^3.13.4",
"react-flexview": "^1.0.13",
"react-headroom": "^2.2.1",
"react-helmet": "^5.2.0",
"react-image-smooth-loading": "^2.0.0",
"react-intl": "^2.3.0",
"react-lazyload": "^2.3.0",
"react-load-script": "0.0.6",
"react-loadable": "^4.0.4",
"react-masonry-component": "^5.0.7",
"react-places-autocomplete": "^5.4.2",
"react-progressive-image-loading": "^3.0.2",
"react-redux": "^5.0.6",
"react-router": "^3.2.0",
"react-router-bootstrap": "^0.23.3",
"react-router-scroll": "^0.4.4",
"react-sidebar": "^2.3.2",
"react-stripe-checkout": "^2.4.0",
"react-swipeable": "^4.3.0",
"recompose": "^0.26.0",
"redux": "^3.7.2",
"rss": "^1.2.2",
"sanitize-html": "^1.16.3",
"sendy-api": "^0.1.0",
"simpl-schema": "^0.2.3",
"sitemap": "^1.13.0",
"speakingurl": "^9.0.0",
"stripe": "^4.24.0",
"styled-components": "^2.1.2",
"tracker-component": "^1.3.21",
"twit": "^2.2.9",
"underscore": "^1.8.3",
"url": "^0.11.0"
},
`` "private": true,
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-eslint": "^7.0.0",
"babel-plugin-inline-import": "^2.0.6",
"babel-plugin-inline-import-graphql-ast": "^2.0.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"compass-sass-mixins": "^0.12.7",
"eslint": "^3.10.1",
"eslint-config-airbnb": "^13.0.0",
"eslint-config-meteor": "0.0.9",
"eslint-import-resolver-meteor": "^0.3.3",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-meteor": "^4.0.1",
"eslint-plugin-prettier": "^2.5.0",
"eslint-plugin-react": "^6.7.1"
},
"postcss": {
"plugins": {
"postcss-easy-import": {
"extensions": [
".css",
".scss",
".import.css"
],
"prefix": "_"
},
"postcss-simple-vars": {},
"postcss-sassy-mixins": {},
"postcss-nested": {},
"autoprefixer": {
"browsers": [
"last 2 versions"
]
}
},
"parser": "postcss-scss"
},
"cssModules": {
"ignorePaths": [
"node_modules",
"bower_components"
]
},
"description": "## Requirements",
"main": "mobile-config.js",
"repository": {
"type": "git",
"url": "git+ssh://git#gitlab.com/enliven/enliven-frontend.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://gitlab.com/enliven/enliven-frontend/issues"
},
"homepage": "https://gitlab.com/enliven/enliven-frontend#README"
}```
I don’t think that you are able to create a bundle into the . folder.
You are meant to pass it the folder in which to store the bundled files which must be different. I would suggest that you create a .bundle folder and pass that to the bundle command. The dot is important because meteor will ignore folders and files beginning with a dot
I have the following simple test in a t.test.js file in my React repo
test('sum', () => {
expect(1+1).toBe(3);
});
I followed the steps to set up Jest using the official guide.
However, when I run npm test, nothing happens. This is the output I get before Jest exits:
> # test
> jest
Using Jest CLI v0.8.2, jasmine1
What could be the problem? No tests are being run in my repository. Here is a dump of my package.json if necessary:
{
"private": true,
"engines": {
"node": ">=5.0 <6",
"npm": ">=3.3 <4"
},
"dependencies": {
"#google/maps": "^0.4.5",
"auth0-lock": "^10.24.3",
"autosuggest-highlight": "^3.1.1",
"aws-sdk": "^2.202.0",
"babel-polyfill": "6.9.1",
"babel-runtime": "6.9.2",
"bluebird": "3.1.1",
"body-parser": "^1.18.2",
"classnames": "2.2.1",
"cookie-parser": "^1.4.3",
"cors": "^2.8.3",
"cron": "^1.3.0",
"dotenv": "^2.0.0",
"downloadjs": "^1.4.7",
"eventemitter3": "1.1.1",
"express": "4.13.3",
"express-formidable": "^1.0.0",
"express-jwt": "^5.1.0",
"fastclick": "1.0.6",
"fbjs": "0.5.1",
"fetch-jsonp": "^1.1.3",
"flux": "2.1.1",
"formsy-react": "^0.19.5",
"front-matter": "2.0.1",
"fuse.js": "^2.5.0",
"google-libphonenumber": "^3.0.12",
"google-map-react": "^0.27.0",
"google-maps-react": "^1.1.2",
"history": "1.16.0",
"intercom-client": "^2.9.2",
"isomorphic-style-loader": "^4.0.0",
"jade": "1.11.0",
"json-loader": "^0.5.7",
"mailchimp-api-v3": "^1.8.0",
"markdown": "^0.5.0",
"mixpanel": "^0.8.0",
"mixpanel-browser": "^2.17.1",
"moment": "^2.20.1",
"moment-timezone": "^0.5.14",
"mongodb": "2.1.7",
"morgan": "^1.9.0",
"node-fetch": "1.3.3",
"normalize.css": "3.0.3",
"passport-auth0": "^0.6.1",
"passport-http": "^0.3.0",
"rc-progress": "^2.2.5",
"react": "^0.14.9",
"react-addons-create-fragment": "^0.14.8",
"react-autosuggest": "^9.3.4",
"react-day-picker": "^2.4.0",
"react-dom": "^0.14.9",
"react-redux": "^4.4.1",
"react-routing": "0.0.6",
"react-scrollable-anchor": "^0.5.0",
"react-share": "^1.19.1",
"react-stripe-checkout": "^1.8.0",
"redux": "^3.3.1",
"sendgrid": "^2.0.0",
"source-map-support": "0.4.0",
"stripe": "^4.25.0",
"tempy": "^0.2.1",
"twilio": "^2.9.1",
"twitter": "^1.7.0",
"underscore": "^1.8.3",
"whatwg-fetch": "0.10.1",
"xhr2": "^0.1.3"
},
"devDependencies": {
"assets-webpack-plugin": "^3.4.0",
"autoprefixer": "^6.1.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^6.0.4",
"babel-jest": "^22.4.1",
"babel-loader": "^6.2.4",
"babel-plugin-react-transform": "^2.0.2",
"babel-plugin-rewire": "^1.0.0-rc-3",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-react-constant-elements": "^6.8.0",
"babel-plugin-transform-react-inline-elements": "^6.8.0",
"babel-plugin-transform-react-remove-prop-types": "^0.2.7",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-node5": "^11.1.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.26.0",
"babel-template": "^6.26.0",
"babel-types": "^6.26.0",
"browser-sync": "^2.23.6",
"css-loader": "^0.28.10",
"csscomb": "^3.1.8",
"del": "^2.2.0",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^2.1.1",
"eslint-loader": "^1.1.1",
"eslint-plugin-react": "^3.11.3",
"extend": "^3.0.0",
"file-loader": "^0.8.5",
"gaze": "^0.5.2",
"git-repository": "^0.1.1",
"glob": "^6.0.1",
"jest": "^22.4.2",
"jest-cli": "^0.8.2",
"jscs": "^2.7.0",
"mkdirp": "^0.5.1",
"ncp": "^2.0.0",
"postcss": "^5.2.18",
"postcss-import": "^7.1.3",
"postcss-loader": "^0.8.0",
"precss": "^1.3.0",
"react-test-renderer": "^16.2.0",
"react-transform-catch-errors": "^1.0.0",
"react-transform-hmr": "^1.0.1",
"redbox-react": "1.2.0",
"replace": "^0.3.0",
"superagent": "^3.8.2",
"supertest": "^3.0.0",
"url-loader": "^0.5.7",
"webpack": "^1.13.0",
"webpack-hot-middleware": "^2.21.0",
"webpack-middleware": "^1.5.1",
"webpack-node-externals": "^1.6.0"
},
"babel": {
"presets": [
"react",
"node5",
"stage-0"
],
"env": {
"test": {
"plugins": [
"rewire"
]
}
},
"plugins": [
"transform-class-properties"
]
},
"jest": {
"rootDir": "./src"
},
"scripts": {
"lint": "eslint src tools && jscs src tools",
"csslint": "csscomb src/components --lint --verbose",
"csscomb": "csscomb src/components --verbose",
"test": "jest",
"clean": "babel-node tools/run clean",
"copy": "babel-node tools/run copy",
"bundle": "babel-node tools/run bundle",
"build": "babel-node tools/run build",
"deploy": "babel-node tools/run deploy",
"start": "babel-node tools/run start"
}
}