Errors in mean.js program after using grunt - npm

I have a mean.js program, when i do npm install to this here:
{
"name": "footbos",
"description": "footbos",
"version": "0.0.1",
"author": "Footbos",
"engines": {
"node": "0.10.x",
"npm": "1.4.x"
},
"scripts": {
"start": "grunt",
"test": "grunt test",
"postinstall": "bower install --config.interactive=false"
},
"dependencies": {
"body-parser": "~1.2.0",
"bower": "~1.3.1",
"compression": "~1.0.1",
"connect-flash": "~0.1.1",
"connect-mongo": "~0.4.0",
"consolidate": "~0.10.0",
"cookie-parser": "~1.1.0",
"express": "~4.2.0",
"express-session": "~1.1.0",
"forever": "~0.11.0",
"glob": "~3.2.9",
"grunt-cli": "~0.1.13",
"helmet": "~0.2.1",
"lodash": "~2.4.1",
"method-override": "~1.0.0",
"mongoose": "~3.8.8",
"morgan": "~1.1.0",
"passport": "~0.2.0",
"passport-facebook": "~1.0.2",
"passport-google-oauth": "~0.1.5",
"passport-linkedin": "~0.1.3",
"passport-local": "~1.0.0",
"passport-twitter": "~1.0.2",
"q": "^1.1.2",
"swig": "~1.3.2"
},
"devDependencies": {
"supertest": "~0.12.1",
"should": "~3.3.1",
"grunt-env": "~0.4.1",
"grunt-node-inspector": "~0.1.3",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-csslint": "^0.2.0",
"grunt-ngmin": "0.0.3",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-cssmin": "~0.9.0",
"grunt-nodemon": "~0.2.1",
"grunt-concurrent": "~0.5.0",
"grunt-mocha-test": "~0.10.0",
"grunt-karma": "~0.8.2",
"load-grunt-tasks": "~0.4.0",
"karma": "~0.12.0",
"karma-jasmine": "~0.2.1",
"karma-coverage": "~0.2.0",
"karma-chrome-launcher": "~0.1.2",
"karma-firefox-launcher": "~0.1.3",
"karma-phantomjs-launcher": "~0.1.2"
}
}
And then i run grunt, i get the errors marked in the pic, why? what are they talking about there? i have no lib/utils, never had this, and it all worked fine before (On my other computer, now burned :( ), What is the meaning of those erros and how do i fix this?

Related

Keeps getting cannot Error: Cannot find module from #hookforms/resolver

I am working on a next js project and while refreshing the page i am getting this error. But when i start from beginning that is signing in and then visiting other pages then this error wont appear. But if there is any error in fetching data from api then it appears.
Here's the complete log:
Uncaught Error: Cannot find module 'C:\Users\abhit\Desktop\Minimal_JavaScript_v3.0.0\Minimal_JavaScript_v3.0.0\modified\node_modules\#hookform\resolvers\yup\dist\yup'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:960:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:953:15)
at resolveExports (node:internal/modules/cjs/loader:483:14)
at Module._findPath (node:internal/modules/cjs/loader:523:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:925:27)
at mod._resolveFilename (file://C:\Users\abhit\Desktop\Minimal_JavaScript_v3.0.0\Minimal_JavaScript_v3.0.0\modified\node_modules\next\dist\build\webpack\require-hook.js:27:32)
at mod._resolveFilename (file://C:\Users\abhit\Desktop\Minimal_JavaScript_v3.0.0\Minimal_JavaScript_v3.0.0\modified\node_modules\next\dist\build\webpack\require-hook.js:27:32)
at mod._resolveFilename (file://C:\Users\abhit\Desktop\Minimal_JavaScript_v3.0.0\Minimal_JavaScript_v3.0.0\modified\node_modules\next\dist\build\webpack\require-hook.js:27:32)
at Module._load (node:internal/modules/cjs/loader:780:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
getServerError # client.js?4d30:7
eval # index.js?46cb:709
setTimeout (async)
Here is my package.json:
{
"name": "apsit-community",
"author": "apsit",
"version": "1.0.0",
"description": "Platform build by students for the students.",
"private": true,
"scripts": {
"lint": "next lint",
"lint:es": "eslint --ext .js,.jsx .",
"lint:fix": "eslint --fix --ext .js,.jsx .",
"dev": "next dev -p 3031",
"build": "next build",
"start": "next start"
},
"dependencies": {
"#auth0/auth0-spa-js": "^1.19.3",
"#emotion/cache": "^11.7.1",
"#emotion/react": "^11.7.1",
"#emotion/server": "^11.4.0",
"#emotion/styled": "^11.6.0",
"#fullcalendar/common": "^5.10.1",
"#fullcalendar/daygrid": "^5.10.1",
"#fullcalendar/interaction": "^5.10.1",
"#fullcalendar/list": "^5.10.1",
"#fullcalendar/react": "^5.10.1",
"#fullcalendar/timegrid": "^5.10.1",
"#fullcalendar/timeline": "^5.10.1",
"#hookform/resolvers": "^2.9.7",
"#iconify/react": "^3.1.0",
"#mui/lab": "^5.0.0-alpha.60",
"#mui/material": "^5.2.4",
"#mui/x-data-grid": "^5.2.1",
"#react-pdf/renderer": "^2.0.21",
"#reduxjs/toolkit": "^1.7.1",
"#turf/bbox": "^6.5.0",
"amazon-cognito-identity-js": "^5.2.3",
"apexcharts": "^3.32.0",
"autosuggest-highlight": "^3.2.0",
"axios": "^0.24.0",
"change-case": "^4.1.2",
"cookie": "^0.4.1",
"d3-array": "^3.1.1",
"d3-scale": "^4.0.2",
"date-fns": "^2.27.0",
"deck.gl": "^8.6.5",
"emoji-mart": "^3.0.0",
"firebase": "^9.6.1",
"framer-motion": "^5.5.5",
"geojson": "^0.5.0",
"highlight.js": "^11.3.1",
"i18next": "^21.6.3",
"i18next-browser-languagedetector": "^6.1.2",
"immutable": "^4.0.0",
"js-cookie": "^3.0.1",
"jsonwebtoken": "^8.5.1",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.19",
"mapbox-gl": "^2.6.1",
"next": "^12.0.7",
"next-transpile-modules": "^9.0.0",
"notistack": "^2.0.3",
"nprogress": "^0.2.0",
"numeral": "^2.0.6",
"prop-types": "^15.8.1",
"react": "^17.0.1",
"react-apexcharts": "^1.3.9",
"react-beautiful-dnd": "^13.1.0",
"react-copy-to-clipboard": "^5.0.4",
"react-dom": "^17.0.2",
"react-dropzone": "^11.4.2",
"react-hook-form": "^7.22.2",
"react-i18next": "^11.15.1",
"react-image-lightbox": "^5.1.4",
"react-lazy-load-image-component": "^1.5.1",
"react-map-gl": "^6.1.18",
"react-markdown": "^7.1.1",
"react-quill": "^2.0.0",
"react-redux": "^7.2.6",
"react-slick": "^0.28.0",
"redux": "^4.1.2",
"redux-persist": "^6.0.0",
"rehype-raw": "^6.1.0",
"simplebar": "^5.3.6",
"simplebar-react": "^2.3.6",
"slick-carousel": "^1.8.1",
"stylis": "^4.0.13",
"stylis-plugin-rtl": "^2.1.1",
"worker-loader": "^3.0.8",
"yup": "^0.32.11"
},
"devDependencies": {
"#next/eslint-plugin-next": "^12.0.7",
"eslint": "^7.32.0",
"eslint-config-next": "^12.0.7",
"eslint-config-prettier": "^8.3.0",
"prettier": "2.5.1",
"typescript": "^4.4.4"
}
}
It's because, you don't have "react-hook-form" So, Try the following:
npm install react-hook-form #hookform/resolvers yup

How does doing an "npm install" install git hooks?

I am newly(ish) responsible for a git repository. When I clone it and look in the .git/hooks directory, there are only sample hooks.
We use NPM as our package manager for the front end UI. After I run an "npm install", I 'all of a sudden' have real git hooks in .git/hooks. How does this work? What am I looking for?
I figure it is some kind of hook, but I am not sure where to start looking to track it down. In my package.json file I see tslint-react-hooks (TSLint rule that enforces the Rules of Hooks) and react-hook-form (Performant, flexible and extensible forms with easy-to-use validation.), but I think these are red herrings.
I've seen this question Putting Git hooks into a repository which talks about getting hooks in place, but I don't see how it happens for this project.
Here is a copy of my package.json file. Thanks for any insights.
{
"name": "ram",
"version": "1.0.0",
"description": "RAM UI Build Tools",
"scripts": {
"test": "jest --coverage --watchAll",
"testOnce": "jest",
"build": "cross-env NODE_ENV=production node ./Config/prod.js",
"build:dev": "cross-env NODE_ENV=development node ./Config/dev-noserver.js",
"dev": "cross-env NODE_ENV=development nodemon -e js,ts,tsx,json,scss ./Config/dev-noserver.js",
"start": "cross-env NODE_ENV=development node ./Config/dev.js",
"start:full": "webpack-dev-server --progress --config ./Config/dev-noserver-hot.js",
"precommit": "lint-staged"
},
"lint-staged": {
"*.{js,ts,tsx,json,scss}": [
"prettier --write",
"git add"
],
"*.scss": [
"stylelint --fix",
"git add"
],
"*.{ts,tsx}": [
"tslint --fix",
"git add"
]
},
"prettier": {
"singleQuote": true,
"tabWidth": 4,
"printWidth": 120
},
"jest": {
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testMatch": [
"**/?(*.)(spec|test).ts?(x)"
],
"modulePaths": [
"<rootDir>/Content"
],
"testPathIgnorePatterns": [
"/node_modules",
"./Config"
],
"collectCoverage": true,
"collectCoverageFrom": [
"**/*.*",
"!**/*.json",
"!**/index.ts"
],
"coveragePathIgnorePatterns": [
"/node_modules/",
"./Config",
"./coverage",
"./Types",
"__snapshots__",
"__tests__",
"index.tsx",
"./Content/Pages",
"./Content/Utils/constants.ts"
],
"coverageReporters": [
"html"
],
"setupFilesAfterEnv": [
"./Config/Test/testFramework.js"
],
"testURL": "http://localhost/"
},
"author": "xxxxxxxxxxxxx",
"license": "UNLICENSED",
"private": true,
"devDependencies": {
"#types/classnames": "2.2.3",
"#types/enzyme": "3.1.10",
"#types/history": "4.6.2",
"#types/jest": "22.2.3",
"#types/jquery": "3.3.1",
"#types/lodash": "4.14.110",
"#types/object-hash": "1.2.0",
"#types/query-string": "6.2.0",
"#types/react-beautiful-dnd": "12.1.2",
"#types/react-bootstrap": "0.32.21",
"#types/react-datepicker": "2.9.5",
"#types/react-dom": "18.0.0",
"#types/react-js-pagination": "3.0.3",
"#types/react-router": "4.0.23",
"#types/react-router-dom": "4.2.6",
"#types/react-test-renderer": "16.0.1",
"#types/react-toggle": "4.0.2",
"#types/styled-components": "5.1.25",
"#types/uuid": "3.4.3",
"#types/webpack-env": "1.13.6",
"#typescript-eslint/eslint-plugin": "5.35.1",
"#typescript-eslint/parser": "5.35.1",
"axios-mock-adapter": "1.15.0",
"cross-env": "5.1.4",
"css-hot-loader": "1.3.9",
"css-loader": "0.28.11",
"ejs-loader": "0.3.1",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.1.1",
"eslint": "8.22.0",
"eslint-config-standard-with-typescript": "22.0.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-n": "15.2.5",
"eslint-plugin-promise": "6.0.1",
"eslint-plugin-react": "7.31.0",
"html-webpack-plugin": "3.2.0",
"husky": "0.14.3",
"jest": "26.4.2",
"lint-staged": "13.0.3",
"mini-css-extract-plugin": "0.4.0",
"node-sass": "4.14.0",
"nodemon": "1.17.3",
"postcss-flexbugs-fixes": "3.3.0",
"postcss-loader": "2.1.4",
"prettier": "1.19.1",
"react-test-renderer": "18.2.0",
"sass-loader": "7.0.1",
"style-loader": "0.20.3",
"stylelint": "9.2.0",
"stylelint-config-recommended-scss": "3.2.0",
"stylelint-declaration-strict-value": "1.0.4",
"stylelint-declaration-use-variable": "1.6.1",
"stylelint-formatter-pretty": "1.0.3",
"stylelint-scss": "3.0.0",
"stylelint-webpack-plugin": "0.10.4",
"ts-jest": "26.3.0",
"ts-loader": "8.0.3",
"ts-react": "1.2.1",
"tsconfig-paths-webpack-plugin": "3.0.4",
"tslint": "6.1.3",
"tslint-config-prettier": "1.18.0",
"tslint-loader": "3.5.4",
"tslint-react": "5.0.0",
"tslint-react-hooks": "2.2.2",
"typescript": "4.6.4",
"webpack": "4.46.0",
"webpack-cli": "2.0.14",
"webpack-dev-server": "3.10.3",
"xml2js": "0.4.19"
},
"dependencies": {
"#hapi/cryptiles": "*",
"#types/react-table": "6.7.12",
"axios": "0.27.2",
"babel-loader": "8.2.5",
"bootstrap": "3.3.5",
"chokidar": "3.5.3",
"classnames": "2.2.5",
"core-js": "3.24.1",
"ejs": "3.1.8",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-react-app": "7.0.1",
"eslint-plugin-jsx-a11y": "6.6.1",
"eslint-utils": "3.0.0",
"eventsource": "2.0.2",
"expose-loader": "0.7.5",
"file-loader": "1.1.11",
"font-awesome": "4.7.0",
"highcharts": "10.1.0",
"highcharts-react-official": "3.0.0",
"history": "4.7.2",
"jquery": "2.1.1",
"json-schema": "0.4.0",
"lodash": "4.17.21",
"object-hash": "1.3.1",
"popper": "1.0.1",
"powerbi-client": "2.18.6",
"powerbi-client-react": "1.3.3",
"prop-types": "15.6.1",
"querystring": "0.2.0",
"react": "18.2.0",
"react-beautiful-dnd": "13.0.0",
"react-bootstrap": "0.33.1",
"react-datepicker": "4.8.0",
"react-dev-utils": "12.0.1",
"react-dom": "18.2.0",
"react-filtered-multiselect": "0.5.1",
"react-hook-form": "6.5.3",
"react-input-switch": "2.2.2",
"react-js-pagination": "3.0.3",
"react-promise": "2.0.3",
"react-query": "3.39.0",
"react-router-dom": "4.2.2",
"react-socks": "2.2.0",
"react-string-replace": "0.4.1",
"react-super-select": "1.0.23",
"react-table": "6.8.6",
"react-table-hoc-fixed-columns": "1.0.0-beta.9",
"react-toastify": "5.5.0",
"react-toggle": "4.1.3",
"shell-quote": "1.7.3",
"string-replace-to-array": "1.0.3",
"styled-components": "5.3.5",
"sweetalert": "2.1.2",
"sync-request": "6.0.0",
"tar": "6.1.11",
"ts-node": "10.9.1",
"ts-node-dev": "2.0.0",
"uglify-js": "3.15.5",
"url-parse": "1.5.10",
"uuid": "8.3.2",
"webpack-dev-middleware": "5.3.3"
}
}
Installing devDependency "husky": "0.14.3" is the culprit.

SyntaxError: Unexpected token typeof

When i perform yarn test getting this issue
SyntaxError: Unexpected token typeof
Not used typeof in the project but it's used in react-native package. Also gone through this SO question, accepted answer is not working and another answer (adding react-native-web package) is giving some other problems.
Do we have any solution to solve this problem
Edit
package.json
{
"name": "xxxx",
"version": "x.x.xx",
"description": "xxx",
"author": "xxx",
"main": "lib/index.js",
"scripts": {
"dev": "node scripts/dev-server.js",
"build": "bin/build",
"build:mobile": "bin/build-mobile",
"start": "npm run dev",
"start:mobile": "bin/start-mobile",
"android": "bin/android",
"ios": "bin/ios",
"lint": "eslint --ext .js,.jsx src",
"lint-fix": "eslint --fix --ext .js,.jsx src",
"test": "jest",
"validate": "yarn test",
"snapshot": "jest --updateSnapshot",
"test:mobile": "bin/test-mobile",
"eject:mobile": "bin/eject-mobile",
"prepublishOnly": "yarn build",
"configureConsumerRepo": "git submodule init && yarn pullConsumerRepo",
"pullConsumerRepo": "git submodule update --remote --merge",
"patch": "npm version patch -m \"Upgrade to %s\"",
"mobile": "yarn build:mobile && yarn start:mobile"
},
"husky": {
"hooks": {
"pre-push": "yarn validate"
}
},
"dependencies": {
"chroma-js": "^1.3.4",
"moment": "^2.19.3",
"react-native-parsed-text": "^0.0.20",
"scroll-into-view": "^1.9.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.22.1",
"babel-eslint": "^8.0.1",
"babel-jest": "^21.2.0",
"babel-loader": "^7.1.1",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.3.2",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^2.0.1",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"cssnano": "^3.10.0",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
"enzyme-to-json": "^3.1.2",
"eslint": "^4.8.0",
"eslint-config-airbnb": "^16.0.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-import-resolver-webpack": "^0.8.3",
"eslint-loader": "^1.9.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.11.1",
"friendly-errors-webpack-plugin": "^1.1.3",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"husky": "^1.0.0-rc.1",
"jest-cli": "^21.2.1",
"jest-junit": "^3.3.0",
"jest-styled-components": "^4.9.0",
"normalize.css": "^7.0.0",
"opn": "^5.1.0",
"optimize-css-assets-webpack-plugin": "^2.0.0",
"ora": "^1.2.0",
"postcss-flexbugs-fixes": "^3.2.0",
"postcss-loader": "^2.0.6",
"prop-types": "^15.6.0",
"react": "^16.13.1",
"react-dom": "^16.0.0-rc.3",
"react-helmet": "^5.2.0",
"react-native": "0.63.4",
"react-native-mock-render": "^0.0.16",
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
"react-select": "^2.1.0",
"react-test-renderer": "^16.2.0",
"redux": "^3.7.2",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"style-loader": "^0.19.0",
"styled-components": "^2.2.1",
"url-loader": "^0.5.8",
"wdio-mocha-framework": "^0.5.11",
"wdio-sauce-service": "^0.4.4",
"webdriverio": "^4.9.11",
"webpack": "^2.6.1",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.18.0",
"webpack-merge": "^4.1.0"
},
"jest": {
"notify": true,
"setupFiles": [
"<rootDir>/src/components/__tests__/shim.js"
],
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/components/__tests__/assetsTransformer.js",
"\\.(css|less)$": "<rootDir>/src/components/__tests__/assetsTransformer.js"
},
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
"testPathIgnorePatterns": [
"<rootDir>/src/components/__tests__/shim.js",
"<rootDir>/src/components/__tests__/utils.js",
"<rootDir>/src/components/__tests__/assetsTransformer.js",
"<rootDir>/webdriverio-test/"
]
},
"engines": {
"node": ">= 10.0.0",
"npm": ">= 6.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"peerDependencies": {
"react-native-fast-image": "^5.2.0"
}
}

Error: Plugin/Preset files are not allowed to export objects, only functions - Babel jest

I am setting up babel jest in my Vue project. Updating babel is giving me this error.
Error: Plugin/Preset files are not allowed to export objects, only functions - in babel-preset-stage2
Here is my package.json:
{
"name": "JOM",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "node build/build.js",
"lint": "vue-cli-service lint",
"test:e2e": "node test/e2e/runner.js",
"test": "npm run unit",
"pa11y": "pa11y-ci --config pa11y-config.json -j > pa11y-results.json",
"unit": "jest --config jest.config.js",
"serve": "vue-cli-service serve"
},
"dependencies": {
"#sentry/browser": "^5.6.3",
"#sentry/integrations": "^5.6.1",
"#tinymce/tinymce-vue": "^2.0.0",
"axios": "^0.18.0",
"babel-preset-es2015": "^6.24.1",
"cookie": "^0.4.0",
"core-js": "^2.6.5",
"file-saver": "^2.0.2",
"lodash.debounce": "^4.0.8",
"moment": "^2.24.0",
"register-service-worker": "^1.6.2",
"serve": "^11.0.0",
"tinymce": "^5.0.15",
"vue": "^2.6.10",
"vue-fineuploader": "^2.0.0-rc.9",
"vue-router": "^3.1.3",
"vuetify": "^1.5.18",
"vuetify-loader": "^1.3.0",
"vuex": "^3.0.1"
},
"devDependencies": {
"#babel/core": "^7.1.6",
"#babel/preset-env": "^7.6.0",
"#babel/preset-react": "^7.0.0",
"#babel/preset-stage-2": "^7.0.0",
"#vue/cli-plugin-babel": "^3.7.0",
"#vue/cli-plugin-e2e-nightwatch": "^3.9.0",
"#vue/cli-plugin-eslint": "^3.7.0",
"#vue/cli-plugin-pwa": "^3.7.0",
"#vue/cli-plugin-unit-jest": "^3.9.0",
"#vue/cli-service": "^3.7.0",
"#vue/eslint-config-standard": "^4.0.0",
"#vue/test-utils": "^1.0.0-beta.29",
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^8.2.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^21.2.0",
"babel-loader": "^8.0.4",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.24.1",
"babel-register": "^6.22.0",
"chalk": "^2.4.2",
"chromedriver": "^2.27.2",
"copy-webpack-plugin": "^4.0.1",
"cross-spawn": "^5.0.1",
"css-loader": "^0.28.0",
"eslint": "^4.15.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0",
"file-loader": "^1.1.4",
"jest": "^22.4.4",
"jest-serializer-vue": "^0.3.0",
"lint-staged": "^8.1.5",
"pa11y": "^5.2.0",
"pa11y-ci": "^2.3.0",
"sinon": "^7.4.2",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.2",
"vue-jest": "^1.4.0",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^4.25.1",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.2.2"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,vue}": [
"vue-cli-service lint",
"git add"
]
}
}
Babel configuration:.babelrc
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"],
"env": {
"test": {
"presets": ["env", "#babel/preset-stage-2"],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}
jest.config.js
module.exports = {
moduleFileExtensions: [
'js',
'jsx',
'json',
'vue'
],
transform: {
'^.+\\.vue$': '<rootDir>/node_modules/vue-jest',
'^.+\\.jsx?$': 'babel-jest'
},
moduleNameMapper: {
'^#/(.*)$': '<rootDir>/src/$1'
},
snapshotSerializers: [
'jest-serializer-vue'
],
setupFiles: ['<rootDir>/tests/jest-setup'],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
mapCoverage: true,
testURL: 'http://localhost/'
}
Can someone please help me with a solution? It looks like an issue with babel version. This happens after i upgrade my babel jest

How to use HAML inside a .vue file in vue 3-rc.3

I am trying to use HAML inside the .vuefile in the vue version 3 but it is not working.
What I did.
Intall vue cli version 3.0.0-rc.3
Created a new project with:
My package is:
{
"name": "project 3",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"haml": "^0.4.3",
"haml-haml-loader": "^1.0.1",
"hamljs": "^0.6.2",
"register-service-worker": "^1.0.0",
"vue": "^2.5.16",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"#vue/cli-plugin-babel": "^3.0.0-beta.15",
"#vue/cli-plugin-eslint": "^3.0.0-beta.15",
"#vue/cli-plugin-pwa": "^3.0.0-beta.15",
"#vue/cli-plugin-unit-mocha": "^3.0.0-beta.15",
"#vue/cli-service": "^3.0.0-beta.15",
"#vue/test-utils": "^1.0.0-beta.16",
"chai": "^4.1.2",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue-template-compiler": "^2.5.16"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
In the old vue cli version 2 with pwa template it worked fine, my package.json for the one that works:
{
"name": "project",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "Ruan Carlos <ruanltbg#gmail.com>",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js",
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"
},
"dependencies": {
"haml": "^0.4.3",
"haml-haml-loader": "^1.0.1",
"hamljs": "^0.6.2",
"vue": "^2.5.2",
"vue-router": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.5",
"babel-core": "^6.26.0",
"sw-precache-webpack-plugin": "^0.11.4",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.1.2",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.0",
"babel-preset-stage-2": "^6.24.1",
"babel-register": "^6.26.0",
"chalk": "^2.1.0",
"connect-history-api-fallback": "^1.4.0",
"copy-webpack-plugin": "^4.1.1",
"css-loader": "^0.28.7",
"cssnano": "^3.10.0",
"eslint": "^4.9.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-html": "^3.2.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-config-airbnb-base": "^11.1.3",
"eslint-import-resolver-webpack": "^0.8.1",
"eventsource-polyfill": "^0.9.6",
"express": "^4.16.2",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.5",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"http-proxy-middleware": "^0.17.4",
"webpack-bundle-analyzer": "^2.9.0",
"cross-env": "^5.0.5",
"karma": "^1.7.1",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-phantomjs-shim": "^1.5.0",
"karma-sinon-chai": "^1.3.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.31",
"karma-webpack": "^2.0.5",
"mocha": "^4.0.1",
"chai": "^4.1.2",
"sinon": "^4.0.1",
"sinon-chai": "^2.14.0",
"inject-loader": "^3.0.1",
"babel-plugin-istanbul": "^4.1.5",
"phantomjs-prebuilt": "^2.1.15",
"chromedriver": "^2.33.1",
"cross-spawn": "^5.1.0",
"nightwatch": "^0.9.16",
"selenium-server": "^3.6.0",
"semver": "^5.4.1",
"shelljs": "^0.7.8",
"opn": "^5.1.0",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.3.0",
"rimraf": "^2.6.2",
"url-loader": "^0.6.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.3",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.7.1",
"webpack-dev-middleware": "^1.12.0",
"webpack-hot-middleware": "^2.19.1",
"webpack-merge": "^4.1.0",
"uglify-es": "^3.1.3"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
Does anybody has any clue?