babel v7 upgrade causing unexpected token import in files imported by related path and in plugin-transform-runtime - babeljs

After upgrading to 7 none of the googled answers not working.
I have a project structure
package.json
"scripts": {
"start": "yarn dev:start",
"restart": "touch src/shared/app.jsx",
"dev:start": "cross-env BABEL_ENV=dev nodemon -e js,jsx --watch src/server --exec babel-node src/server",
"dev:wds": "cross-env BABEL_ENV=dev webpack-dev-server --progress --info-verbosity verbose",
"prod:build": "rimraf lib dist && babel src -d lib --ignore .test.js && cross-env NODE_ENV=production webpack -p --progress --color --display-error-details",
"prod:start": "cross-env NODE_ENV=production pm2 start lib/server && pm2 logs",
"prod:stop": "pm2 delete server",
"lint": "eslint src webpack.config.babel.js --ext .js,.jsx",
"test": "yarn lint && flow && jest --coverage",
"precommit": "yarn test",
"prepush": "yarn test && yarn prod:build"
},
"devDependencies": {
"#babel/cli": "^7.8.4",
"#babel/core": "^7.0.0",
"#babel/node": "^7.0.0",
"#babel/plugin-proposal-class-properties": "^7.0.0",
"#babel/plugin-proposal-json-strings": "^7.0.0",
"#babel/plugin-syntax-dynamic-import": "^7.8.3",
"#babel/plugin-syntax-import-meta": "^7.0.0",
"#babel/plugin-transform-modules-commonjs": "^7.8.3",
"#babel/plugin-transform-runtime": "^7.8.3",
"#babel/preset-env": "^7.0.0",
"#babel/preset-flow": "^7.0.0",
"#babel/preset-react": "^7.0.0",
"#babel/register": "^7.8.3",
"#gfx/zopfli": "^1.0.10",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
"babel-loader": "^8.0.0",
"babel-plugin-flow-react-proptypes": "^4.1.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-recharts": "^1.2.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.14",
"babel-plugin-webpack-alias": "^2.1.2",
"compression-webpack-plugin": "^2.0.0",
"cross-env": "^5.2.0",
"css-loader": "^0.28.5",
"html-webpack-plugin": "^3.2.0",
"isomorphic-style-loader": "^4.0.0",
"jest": "^20.0.4",
"lodash-webpack-plugin": "^0.11.5",
"sass-loader": "^6.0.6",
"style-loader": "^0.18.2",
"url-loader": "^0.5.9",
"webpack": "^4.22.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.10.3"
},
"dependencies": {
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-object-rest-spread": "^7.0.0",
"#babel/runtime": "^7.3.4",
"#babel/runtime-corejs3": "^7.4.3",
"babel-plugin-transform-imports": "^1.5.0",
"core-js": "^3.6.4",
"webpack-spritesmith": "^0.4.1"
}
babel.config.json
{
"presets": [
[
"#babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": {
"version": 3,
"proposals": true
},
"debug": true
}
],
"#babel/preset-flow",
"#babel/preset-react"
],
"plugins": [
"lodash",
"flow-react-proptypes",
"#babel/plugin-proposal-object-rest-spread",
"#babel/plugin-proposal-class-properties",
[
"transform-imports",
{
"react-router": {
"transform": "react-router/${member}",
"preventFullImport": true
}
}
],
[
"#babel/plugin-transform-runtime",
{
"corejs": 3,
"helpers": true,
"useESModules": true
}
]
]
}
First babel doesn't transpile plugin-transform-runtime (or perhaps any file in node_modules)
After babel-node src/server
Got an error Unexpeted token import
Second If i turn off plugin-transform-runtime, everything is fine, until babel meet a
relative imported file and import in it
Every others import constructions don't lead to such errors
imported file causing error importing in it
Error just here
Whatever packages i've been installed, whatever config files neither .babelrc nor babel.config.json - not working, in babel 6 have no problems
Is it rooting or structure issues, or maybe config?
Tried to re-install all packages, clearing cache. Same error
However, prod:build aka babel src -d lib is working fine, but webpack then crushed on same
\node_modules\#babel\runtime-corejs3\helpers\esm\defineProperty.js:1
(function (exports, require, module, __filename, __dirname) { import _Object$defineProperty from "../../core-js/object/define-property";
^^^^^^
SyntaxError: Unexpected token import
at new Script (vm.js:51:7)
at NativeCompileCache._moduleCompile (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\v8-compile-cache\v8-compile-cache.js:226:18)
at Module._compile (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\v8-compile-cache\v8-compile-cache.js:172:36)
at Module._compile (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (module.js:660:10)
at Object.newLoader [as .js] (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\pirates\lib\index.js:104:7)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Module.require (module.js:593:17)
at require (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Object.<anonymous> (C:\Users\marat.m\PhpstormProjects\b2b-node\webpack.config.babel.js:29:47)
at Module._compile (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\v8-compile-cache\v8-compile-cache.js:178:30)
at Module._compile (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (module.js:660:10)
at Object.newLoader [as .js] (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\pirates\lib\index.js:104:7)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Module.require (module.js:593:17)
at require (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at WEBPACK_OPTIONS (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\webpack-cli\bin\convert-argv.js:133:13)
at requireConfig (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\webpack-cli\bin\convert-argv.js:135:6)
at C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\webpack-cli\bin\convert-argv.js:142:17
at Array.forEach (<anonymous>)
at module.exports (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\webpack-cli\bin\convert-argv.js:140:15)
at yargs.parse (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\webpack-cli\bin\cli.js:241:39)
at Object.parse (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\webpack-cli\node_modules\yargs\yargs.js:563:18)
at C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\webpack-cli\bin\cli.js:219:8
at Object.<anonymous> (C:\Users\marat.m\PhpstormProjects\b2b-node\node_modules\webpack-cli\bin\cli.js:538:3)

Related

Found the error when I deploy the next.js app in cPannal

I want to deploy my next.js app in cPannel. I follow all the steps but I received the errors in the stderr.log file. the errors is
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'next'
Require stack:
- /home/yourhikf/dev.yourguide.pk/server.js
- /usr/local/lsws/fcgi-bin/lsnode.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/home/yourhikf/dev.yourguide.pk/server.js:4:14)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/yourhikf/dev.yourguide.pk/server.js',
'/usr/local/lsws/fcgi-bin/lsnode.js'
]
}
This is the error that is logged when I want to load the deployed site. The package.json file has the following packages
{
"name": "yourguide-next-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
"#emotion/react": "^11.9.3",
"#emotion/styled": "^11.9.3",
"#mui/material": "^5.9.2",
"#tinymce/tinymce-react": "^4.2.0",
"cookies": "^0.8.0",
"js-cookie": "^3.0.1",
"next": "12.2.3",
"react": "18.2.0",
"react-bootstrap": "^2.4.0",
"react-dom": "18.2.0",
"tinymce": "^6.1.2"
},
"devDependencies": {
"eslint": "8.20.0",
"eslint-config-next": "12.2.3"
}
}
I am unable to solve the problem kindly tell me the solution of my problem.
I solved it by entering the following commands in the terminal:
npm update
npm install

how to solve mongoParseError in nodeModule?

this is output after run yarn start having this is the error:
`yarn run v1.22.17
warning ../../../package.json: No license field
$ ts-node index.ts
MongoParseError: Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"
at new ConnectionString (/Users/youmnasalloum/Desktop/ts/user/node_modules/mongodb-connection-string-url/src/index.ts:133:13)
at parseOptions (/Users/youmnasalloum/Desktop/ts/user/node_modules/mongoose/node_modules/mongodb/src/connection_string.ts:253:15)
at new MongoClient (/Users/youmnasalloum/Desktop/ts/user/node_modules/mongoose/node_modules/mongodb/src/mongo_client.ts:337:34)
at /Users/youmnasalloum/Desktop/ts/user/node_modules/mongoose/lib/connection.js:783:16
at new Promise (<anonymous>)
at NativeConnection.Connection.openUri (/Users/youmnasalloum/Desktop/ts/user/node_modules/mongoose/lib/connection.js:780:19)
at Mongoose.createConnection (/Users/youmnasalloum/Desktop/ts/user/node_modules/mongoose/lib/index.js:285:10)
at Object.<anonymous> (/Users/youmnasalloum/Desktop/ts/user/db/index.ts:9:28)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Module.m._compile (/Users/youmnasalloum/Desktop/ts/user/node_modules/ts-node/src/index.ts:1455:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [start] Error 1`
this is package.json:
{ "name": "user", "version": "1.0.0", "main": "index.ts", "repository": "https://github.com/ArtistCrowdfundExchange/user", "author": "Oghogho Odemwingie", "license": "MIT", "devDependencies": { "#types/bcrypt": "^3.0.0", "#types/node": "^17.0.13", "typescript": "4.5.5" }, "scripts": { "start": "ts-node index.ts", "test": "echo no tests yet" }, "dependencies": { "#aws-sdk/client-s3": "^3.41.0", "#grpc/grpc-js": "^1.3.7", "amqp": "^0.2.7", "aws4": "^1.11.0", "bcrypt": "^5.0.0", "cuid": "^2.1.8", "encrypter": "^1.0.0", "erax.db": "^3.3.1", "jose": "3", "mongodb": "^4.5.0", "mongodb-uri": "^0.9.7", "mongoose": "6.1.8", "nanoid": "^3.1.29", "proto": "git+https://github.com/ArtistCrowdfundExchange/proto#playground", "ts-node": "^10.4.0", "winston": "^3.3.3", "yael-autoencrypt": "^1.1.0" } }
I tried to add packages mongo-Uri,mongo-connection-string-URI using yarn but still the same error when I do yarn start

'import' and 'export' may appear only with 'sourceType: module when import "#solana/web3.js"

I am going to use solanaweb3 on babelrc project.
When I run npm start I am getting .
I have gone through many posts on github and stackoverflow.
npm install -g browserify
npm install --save-dev browserify babelify babel-preset-es2015 babel-preset-stage-0 babel-preset-env babel-preset-react
npm install #babel/core --save
What is solution?
Here is my package.json content.
"scripts": {
"start": "budo src/index.js"
},
"dependencies": {
"#babel/runtime": "^7.14.8",
"#solana/web3.js": "^1.29.2",
"babel-core": "7.0.0-bridge.0"
},
"devDependencies": {
"#babel/core": "^7.15.5",
"#babel/plugin-transform-runtime": "^7.15.0",
"#babel/preset-env": "^7.15.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babelify": "^10.0.0",
"browserify": "^16.5.2",
"budo": "^11.6.4"
},
"browserify": {
"transform": [
[
"babelify",
{
"presets": [
"#babel/preset-env"
]
}
]
]
}
}

Ionic 4: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema

i have a problem with my ionic 4 app. If I use ng serve or other commands as to one to build I have the following error. This error happens after a npm install. I think is related to some new versions of dependencies but I don't know which one.
Here my package.json:
{
"name": "example",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"run:ios": "ionic cordova run ios -l",
"run:browser": "ionic cordova run browser -l --live-reload",
"run:android": "ionic cordova emulate android -l",
"run:android_real_dev": "ionic cordova run android -l",
"build:ios:aot": "ionic cordova build ios --aot --minifyjs --minifycss --releas",
"build:ios:prod": "ionic cordova build ios --prod",
"build:browser:aot": "ionic cordova build browser --aot --minifyjs --minifycss --releas",
"build:android:aot": "ionic cordova build android --aot --minifyjs --minifycss --releas",
"build:android:prod": "ionic cordova build android --prod"
},
"private": true,
"dependencies": {
"#agm/core": "^1.0.0-beta.5",
"#angular/common": "^7.2.2",
"#angular/core": "^7.2.2",
"#angular/forms": "^7.2.2",
"#angular/http": "^7.2.2",
"#angular/platform-browser": "^7.2.2",
"#angular/platform-browser-dynamic": "^7.2.2",
"#angular/router": "^7.2.2",
"#ionic-native/call-number": "^5.2.0",
"#ionic-native/core": "^5.0.0",
"#ionic-native/dialogs": "^5.2.0",
"#ionic-native/file": "^5.3.0",
"#ionic-native/geolocation": "^5.2.0",
"#ionic-native/image-picker": "^5.2.0",
"#ionic-native/launch-navigator": "^5.2.0",
"#ionic-native/native-geocoder": "^5.2.0",
"#ionic-native/social-sharing": "^5.3.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^4.1.0",
"#ionic/app-scripts": "^3.2.3",
"#ionic/storage": "^2.2.0",
"#ngx-translate/core": "^11.0.1",
"#ngx-translate/http-loader": "^4.0.0",
"agm-direction": "^0.7.6",
"balanced-match": "^1.0.0",
"call-number": "1.0.1",
"color": "^3.1.0",
"cordova-android": "8.0.0",
"cordova-browser": "5.0.4",
"cordova-ios": "5.0.1",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-add-swift-support": "1.7.2",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-dialogs": "2.0.1",
"cordova-plugin-file": "~6.0.1",
"cordova-plugin-geolocation": "4.0.1",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^3.1.2",
"cordova-plugin-nativegeocoder": "3.2.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-telerik-imagepicker": "2.2.4",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "5.4.4",
"core-js": "^2.5.4",
"es6-promise-plugin": "4.2.2",
"hammerjs": "^2.0.8",
"ionic-cache": "^4.0.1",
"ionic-swipe-all": "^1.3.0",
"mx.ferreyra.callnumber": "~0.0.2",
"rxjs": "~6.3.3",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "5.0.4",
"zone.js": "~0.8.29"
},
"devDependencies": {
"#angular-devkit/architect": "~0.12.3",
"#angular-devkit/build-angular": "~0.13.0",
"#angular-devkit/core": "~7.2.3",
"#angular-devkit/schematics": "~7.2.3",
"#angular/cli": "~7.3.1",
"#angular/compiler": "~7.2.2",
"#angular/compiler-cli": "~7.2.2",
"#angular/language-service": "~7.2.2",
"#ionic/angular-toolkit": "~1.4.0",
"#types/color": "^3.0.0",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~10.12.0",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.4",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~8.0.0",
"tslint": "~5.12.0",
"typescript": "~3.1.6"
},
"description": "A Custom Listing App project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-dialogs": {},
"mx.ferreyra.callnumber": {},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {
"GOOGLE_API_KEY_FOR_ANDROID": "...",
"LOCATION_USAGE_DESCRIPTION": "This app requires access to your location for navigation purposes",
"OKHTTP_VERSION": "3.12.0"
},
"cordova-plugin-telerik-imagepicker": {
"PHOTO_LIBRARY_USAGE_DESCRIPTION": " "
},
"cordova-plugin-geolocation": {},
"cordova-plugin-nativegeocoder": {
"LOCATION_WHEN_IN_USE_DESCRIPTION": "Use geocoder service"
},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
},
"cordova-plugin-file": {}
},
"platforms": [
"browser",
"android",
"ios"
]
}
}
And the error is:
Cannot destructure property `createHash` of 'undefined' or 'null'.
TypeError: Cannot destructure property `createHash` of 'undefined' or 'null'.
at Object.<anonymous> (/Users/asd/WebstormProjects/customlistingapp/node_modules/mini-css-extract-plugin/dist/index.js:21:5)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/asd/WebstormProjects/customlistingapp/node_modules/mini-css-extract-plugin/dist/cjs.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! example#0.0.1 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the example#0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/asd/.npm/_logs/2019-04-30T10_34_47_445Z-debug.log
I tried to install webpack or the plugin asked locally but the error is the next one. I don't know what to do because I can't run my app neither build it.
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration has an unknown property 'optimization'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
For typos: please correct them.
For loader options: webpack 2 no longer allows custom properties in configuration.
Loaders should be updated to allow passing options via loader options in module.rules.
Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
plugins: [
new webpack.LoaderOptionsPlugin({
// test: /\.xxx$/, // may apply this only for some modules
options: {
optimization: ...
}
})
]
- configuration.output has an unknown property 'futureEmitAssets'. These properties are valid:
object { auxiliaryComment?, chunkFilename?, crossOriginLoading?, jsonpScriptType?, chunkLoadTimeout?, devtoolFallbackModuleFilenameTemplate?, devtoolLineToLine?, devtoolModuleFilenameTemplate?, filename?, hashDigest?, hashDigestLength?, hashFunction?, hashSalt?, hotUpdateChunkFilename?, hotUpdateFunction?, hotUpdateMainFilename?, jsonpFunction?, library?, libraryTarget?, libraryExport?, path?, pathinfo?, publicPath?, sourceMapFilename?, sourcePrefix?, strictModuleExceptionHandling?, umdNamedDefine? }
-> Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration has an unknown property 'optimization'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
For typos: please correct them.
For loader options: webpack 2 no longer allows custom properties in configuration.
Loaders should be updated to allow passing options via loader options in module.rules.
Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
plugins: [
new webpack.LoaderOptionsPlugin({
// test: /\.xxx$/, // may apply this only for some modules
options: {
optimization: ...
}
})
]
- configuration.output has an unknown property 'futureEmitAssets'. These properties are valid:
object { auxiliaryComment?, chunkFilename?, crossOriginLoading?, jsonpScriptType?, chunkLoadTimeout?, devtoolFallbackModuleFilenameTemplate?, devtoolLineToLine?, devtoolModuleFilenameTemplate?, filename?, hashDigest?, hashDigestLength?, hashFunction?, hashSalt?, hotUpdateChunkFilename?, hotUpdateFunction?, hotUpdateMainFilename?, jsonpFunction?, library?, libraryTarget?, libraryExport?, path?, pathinfo?, publicPath?, sourceMapFilename?, sourcePrefix?, strictModuleExceptionHandling?, umdNamedDefine? }
-> Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
at webpack (/Users/asd/WebstormProjects/customlistingapp/node_modules/webpack/lib/webpack.js:19:9)
at WebpackBuilder.createWebpackCompiler (/Users/asd/WebstormProjects/customlistingapp/node_modules/#angular-devkit/build-webpack/src/webpack/index.js:20:16)
at Observable.rxjs_1.Observable.obs [as _subscribe] (/Users/asd/WebstormProjects/customlistingapp/node_modules/#angular-devkit/build-webpack/src/webpack/index.js:24:42)
at Observable._trySubscribe (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/Observable.js:44:25)
at Observable.subscribe (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/Observable.js:30:22)
at /Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/util/subscribeTo.js:22:31
at Object.subscribeToResult (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
at MergeMapSubscriber._innerSub (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/operators/mergeMap.js:82:29)
at MergeMapSubscriber._tryNext (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/operators/mergeMap.js:76:14)
at MergeMapSubscriber._next (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/Subscriber.js:67:18)
at MergeMapSubscriber.notifyNext (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
at InnerSubscriber._next (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/Subscriber.js:67:18)
at MergeMapSubscriber.notifyNext (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
at InnerSubscriber._next (/Users/asd/WebstormProjects/customlistingapp/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! example#0.0.1 build: `ng build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the example#0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/asd/.npm/_logs/2019-04-30T10_27_10_155Z-debug.log

using protractor-cucumber-framework for testing it gives this error

Hello friends i testing my angular 2 app using protractor and cucumber js but it give me this error i try several solution for this issue but no one can solve my issue.if you know any sol it would be great thank u..
[1] Unhandled rejection TypeError: this.registerHandler is not a function
[1] at Object.registerHandlers (/home/ca1/WebstormProjects/DME/node_modules/protractor-cucumber-framework/lib/resultsCapturer.js:16:8)
[1] at /home/ca1/WebstormProjects/DME/node_modules/protractor-cucumber-framework/lib/resultsCapturer.js:6:22
[1] at Object.defineSupportCode (/home/ca1/WebstormProjects/DME/node_modules/cucumber/src/support_code_library_builder/index.js:20:9)
[1] at Object. (/home/ca1/WebstormProjects/DME/node_modules/protractor-cucumber-framework/lib/resultsCapturer.js:5:12)
[1] at Module._compile (module.js:570:32)
[1] at Object.Module._extensions..js (module.js:579:10)
[1] at Module.load (module.js:487:32)
[1] at tryModuleLoad (module.js:446:12)
[1] at Function.Module._load (module.js:438:3)
[1] at Module.require (module.js:497:17)
[1] at require (internal/module.js:20:19)
[1] at /home/ca1/WebstormProjects/DME/node_modules/cucumber/src/cli/index.js:61:42
[1] at Array.forEach (native)
[1] at Cli.getSupportCodeLibrary (/home/ca1/WebstormProjects/DME/node_modules/cucumber/src/cli/index.js:61:22)
[1] at Cli. (/home/ca1/WebstormProjects/DME/node_modules/cucumber/src/cli/index.js:76:37)
[1] at next (native)
[1] [17:30:50] E/launcher - BUG: launcher exited with 1 tasks remaining
here is my package.json
{
"name": "dpt-angular",
"version": "1.0.0",
"description": "QuickStart package.json from the documentation, supplemented with testing support",
"scripts": {
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"e2e": "concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first",
"lint": "tslint ./app/**/*.ts -t verbose",
"lite": "lite-server",
"pree2e": "webdriver-manager update",
"test": "concurrently \"tsc -w\" \"karma start karma.conf.js\"",
"test-once": "karma start karma.conf.js --single-run",
"tsc": "tsc",
"tsc:w": "tsc -w"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"#angular/common": "~2.4.0",
"#angular/compiler": "~2.4.0",
"#angular/core": "~2.4.0",
"#angular/forms": "~2.4.0",
"#angular/http": "~2.4.0",
"#angular/platform-browser": "~2.4.0",
"#angular/platform-browser-dynamic": "~2.4.0",
"#angular/router": "~3.4.0",
"#types/file-saver": "0.0.1",
"angular-in-memory-web-api": "~0.2.4",
"angular2-moment": "^1.1.0",
"core-js": "^2.4.1",
"mydatepicker": "^2.0.25",
"ng2-completer": "^1.5.2",
"ng2-file-upload": "^1.2.1",
"ng2-pdf-viewer": "^1.1.0",
"rxjs": "5.0.1",
"systemjs": "0.19.40",
"zone.js": "^0.7.4"
},
"devDependencies": {
"#types/jasmine": "^2.5.36",
"#types/node": "^6.0.46",
"canonical-path": "0.0.2",
"concurrently": "^3.1.0",
"cucumber": "^3.0.0",
"cucumber-tsflow": "^2.2.0",
"http-server": "^0.9.0",
"jasmine-core": "~2.4.1",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"lite-server": "^2.2.2",
"lodash": "^4.16.4",
"protractor": "^4.0.14",
"protractor-cucumber-framework": "^3.0.0",
"rimraf": "^2.5.4",
"ts-node": "^3.3.0",
"tslint": "^3.15.1",
"typescript": "~2.3.4",
"webdriver-manager": "^12.0.6"
},
"repository": {}
}
and my protractor.conf.json
var fs = require('fs');
var path = require('canonical-path');
var _ = require('lodash');
exports.config = {
directConnect: true,
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
allScriptsTimeout:90000,
getPageTimeout:400000,
ignoreUncaughtExceptions: true,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
// Spec patterns are relative to this config file
specs: ['**/cucumber_test/*.feature' ],
cucumberOpts: {
compiler: "ts:ts-node/register",
require: ['**/*e2e-spec.js'], // require step definition files before executing features
tags: '#TypeScriptScenario,#dev,#AddScenario,#SubtractScenario,#MultiplyScenario,#DivideScenario,#ModulusScenario', // <string[]> (expression) only execute the features or scenarios with tags matching the expression
strict: true, // <boolean> fail if there are any undefined or pending steps
format: ["pretty"], // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
dryRun: false, // <boolean> invoke formatters without executing steps
'fail-fast': true
},
// For angular tests
useAllAngular2AppRoots: true,
// Base URL for application server
baseUrl: 'http://localhost:3000',
// doesn't seem to work.
// resultJsonOutputFile: "foo.json",
onPrepare: function() {
//// SpecReporter
//var SpecReporter = require('jasmine-spec-reporter');
//jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: 'none'}));
//// jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: 'all'}));
// debugging
// console.log('browser.params:' + JSON.stringify(browser.params));
/*jasmine.getEnv().addReporter(new Reporter( browser.params )) ;*/
// Allow changing bootstrap mode to NG1 for upgrade tests
global.setProtractorToNg1Mode = function() {
browser.useAllAngular2AppRoots = false;
browser.rootEl = 'body';
};
// browser.manage().window().maximize();
},
/*jasmineNodeOpts: {
// defaultTimeoutInterval: 60000,
defaultTimeoutInterval: 10000,
showTiming: true,
print: function() {}
}*/
}
This issue will be solved just downgrading the cucumber version 3 to 2.