TLDR: custom events ($listeners) won't be automatically binded in the vue 3 compat build. It is as if all the components would have inheritAttrs: false (although $attrs will be binded and it doesn't include class/style either as the docs say it would)
I followed the official vue 3 migration guide with the compat build, it should've been relatively easy to migrate, however it seems a bit harder as expected. So I added the following code to the vue.config.js:
// Vue 2 => Vue 3 migration config
config.resolve.alias.set('vue', '#vue/compat');
config.module
.rule('vue')
.use('vue-loader')
.tap((options) => ({
...options,
compilerOptions: {
compatConfig: {
MODE: 3,
},
},
}));
Most of the work is already done, however I realised that none of the listeners seems to be working. After some investigation I found out that the $listeners object won't be automatically binded as they should be. They aren't included for some reason in the $attrs object neither will they be inherited (I guess they are related).
I tried INSTANCE_LISTENERS: false, option with both false and true values, unfortunately neither seemed to work. Now the only option I can see right now is adding v-on="$listeners" to all components that may need to bind any events. This is obviously not a good solution, it is hacky and they are also removed in vue 3 completely but I couldn't think of another solution. Did anybody else experience the same and know maybe a better solution for this?
Thanks for your help in advance!
EDIT:
I thought maybe sharing the dependencies could help in detecting the issue so here they are:
"dependencies": {
"#apollo/client": "^3.5.5",
"#datadog/browser-logs": "^2.17.0",
"#datadog/browser-rum": "^2.17.0",
"#popperjs/core": "^2.10.1",
"#rd-internal/rd-vue-gtm": "^1.1.0",
"#vue/apollo-option": "^4.0.0-alpha.15",
"#vue/compat": "^3.2.23",
"#vue/runtime-dom": "^3.2.23",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-link": "^1.2.14",
"apollo-link-schema": "^1.2.5",
"apollo-upload-client": "^14.1.3",
"bootstrap": "^5.1.0",
"bootstrap-vue": "^2.21.2",
"chart.js": "^2.9.4",
"core-js": "^3.17.2",
"dayjs": "^1.10.6",
"graphql": "^15.7.2",
"graphql-tag": "^2.12.6",
"graphql-tools": "^4.0.7",
"intersection-observer": "^0.12.0",
"loader-utils": "^2.0.0",
"lodash.clonedeep": "^4.5.0",
"lodash.debounce": "^4.0.8",
"lodash.get": "^4.4.2",
"lodash.isequal": "^4.5.0",
"lodash.merge": "^4.6.2",
"lodash.set": "^4.3.2",
"lodash.some": "^4.6.0",
"normalize.css": "^8.0.1",
"papaparse": "^5.3.1",
"tinycolor2": "^1.4.2",
"v-tooltip": "^2.1.3",
"vue": "^3.2.23",
"vue-apollo": "^3.0.7",
"vue-chartjs": "^3.5.1",
"vue-ctk-date-time-picker": "^2.5.0",
"vue-i18n": "^9.2.0-beta.22",
"vue-meta": "^2.4.0",
"vue-router": "^4.0.12",
"vuelidate": "^0.7.6",
"vuelidate-error-extractor": "^2.4.1",
"whatwg-fetch": "^3.6.2"
},
"devDependencies": {
"#intlify/eslint-plugin-vue-i18n": "^1.2.0",
"#jagi/jest-transform-graphql": "^1.0.2",
"#testing-library/jest-dom": "^5.14.1",
"#typescript-eslint/eslint-plugin": "^4.30.0",
"#typescript-eslint/parser": "^4.30.0",
"#vue/cli-plugin-babel": "^4.5.15",
"#vue/cli-plugin-eslint": "^4.5.15",
"#vue/cli-plugin-typescript": "^4.5.15",
"#vue/cli-plugin-unit-jest": "^4.5.15",
"#vue/cli-service": "^4.5.15",
"#vue/compiler-sfc": "^3.2.23",
"#vue/eslint-config-airbnb": "^5.3.0",
"#vue/eslint-config-typescript": "^7.0.0",
"#vue/test-utils": "^1.2.2",
"babel-eslint": "^10.1.0",
"babel-jest": "^27.1.0",
"casual-browserify": "^1.5.19-2",
"change-case": "^4.1.2",
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-sonarjs": "^0.10.0",
"eslint-plugin-unicorn": "^35.0.0",
"eslint-plugin-vue": "^7.17.0",
"eslint-plugin-vue-scoped-css": "^1.3.0",
"full-icu": "^1.3.4",
"glob": "^7.1.7",
"html-webpack-plugin": "^4.5.1",
"hygen": "^6.1.0",
"inflection": "^1.13.1",
"jest-junit": "^12.2.0",
"lint-staged": "^11.1.2",
"node-sass": "^6.0.1",
"sass-loader": "^10.2.0",
"sockjs-client": "^1.5.2",
"style-resources-loader": "^1.4.1",
"stylelint": "^13.13.1",
"stylelint-config-standard": "^22.0.0",
"stylelint-declaration-use-variable": "^1.7.3",
"stylelint-no-unsupported-browser-features": "^5.0.1",
"stylelint-order": "^4.1.0",
"stylelint-scss": "^3.20.1",
"ts-jest": "^24.3.0",
"typescript": "^4.4.2",
"vue-cli-plugin-webpack-bundle-analyzer": "~4.0.0",
"vue-composition-test-utils": "^1.0.3"
},
Related
I have searched around for this error and found numerous people reporting it, but none of the solution tried have worked for me. The project I'm working with was ejected from expo with react-native v0.63 installed, and then upgraded to react-native v0.64.3. Everything else is working fine, but the tests are failing. On running yarn test, all the unit tests throw the same error:
src/screens/ScreenTest/ScreenTest.test.js
● Test suite failed to run
SyntaxError: /node_modules/#react-native/polyfills/error-guard.js: Missing semicolon. (14:4)
12 | let _inGuard = 0;
13 |
> 14 | type ErrorHandler = (error: mixed, isFatal: boolean) => void;
| ^
15 | type Fn<Args, Return> = (...Args) => Return;
16 |
17 | /**
at instantiate (node_modules/#babel/parser/lib/index.js:72:32)
at constructor (node_modules/#babel/parser/lib/index.js:367:12)
at Parser.raise (node_modules/#babel/parser/lib/index.js:3706:19)
at Parser.semicolon (node_modules/#babel/parser/lib/index.js:4151:10)
at Parser.parseExpressionStatement (node_modules/#babel/parser/lib/index.js:15453:10)
at Parser.parseStatementContent (node_modules/#babel/parser/lib/index.js:14986:19)
at Parser.parseStatement (node_modules/#babel/parser/lib/index.js:14838:17)
at Parser.parseBlockOrModuleBlockBody (node_modules/#babel/parser/lib/index.js:15495:25)
at Parser.parseBlockBody (node_modules/#babel/parser/lib/index.js:15486:10)
at Parser.parseProgram (node_modules/#babel/parser/lib/index.js:14748:10)
at Parser.parseTopLevel (node_modules/#babel/parser/lib/index.js:14735:25)
at Parser.parse (node_modules/#babel/parser/lib/index.js:16764:10)
at parse (node_modules/#babel/parser/lib/index.js:16816:38)
at parser.next (<anonymous>)
at normalizeFile.next (<anonymous>)
at run.next (<anonymous>)
at transform.next (<anonymous>)
at evaluateSync (node_modules/gensync/index.js:251:28)
at sync (node_modules/gensync/index.js:89:14)
at ScriptTransformer.transformSource (node_modules/#jest/transform/build/ScriptTransformer.js:481:35)
at ScriptTransformer._transformAndBuildScript (node_modules/#jest/transform/build/ScriptTransformer.js:586:40)
at ScriptTransformer.transform (node_modules/#jest/transform/build/ScriptTransformer.js:624:25)
at Object.<anonymous> (node_modules/react-native/jest/setup.js:300:6)
Another thing to note is that I have babel.config.js file in my project already, since a lot of answers mentioned moving from .babelrc to babel.config.js as a solution to this problem, but it didn't help. just to be sure i also tried removing the babel.config.js and adding a .babelrc but that did not work either.
I'm at my wits end here and any help is greatly appreciated!
So far I've tried:
Upgrading/downgrading the jest, babel, and any dependencies to a newer version
How can I stop my React Native tests bombing out on Flow types in Node Modules? => Fixes posted in this thread
https://github.com/react-native-community/upgrade-support/issues/152 => More fixes from this issue
Changing babel plugins and adding/removing transformIgnorePatterns
Creating a fresh, bare react-native#0.64.3 project and running the default test (tests pass after downgrading babel to the recommended version)
babel.config.js:
module.exports = function (api) {
api.cache(false)
return {
env: {
production: {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'module:react-native-dotenv',
'react-native-reanimated/plugin',
'transform-remove-console',
],
},
development: {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['module:react-native-dotenv', 'react-native-reanimated/plugin'],
},
},
}
}
package.json:
{
"dependencies": {
"#expo/vector-icons": "^12.0.0",
"#gorhom/bottom-sheet": "^4.4.2",
"#pnthach95/react-native-root-view-background": "^1.2.0",
"#ptomasroos/react-native-multi-slider": "^2.2.2",
"#react-native-async-storage/async-storage": "^1.13.4",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/netinfo": "^8.3.0",
"#react-native-community/push-notification-ios": "^1.8.0",
"#react-native-firebase/analytics": "12.9.3",
"#react-native-firebase/app": "12.9.3",
"#react-native-firebase/auth": "^12.1.0",
"#react-native-firebase/crashlytics": "12.9.3",
"#react-native-firebase/dynamic-links": "10.8.1",
"#react-native-firebase/in-app-messaging": "12.9.3",
"#react-native-firebase/messaging": "^12.1.0",
"#react-native-firebase/perf": "12.9.3",
"#react-native-firebase/remote-config": "12.9.3",
"#react-native-google-signin/google-signin": "^6.0.1",
"#react-native-masked-view/masked-view": "^0.2.6",
"#react-native-picker/picker": "1.9.2",
"#react-navigation/bottom-tabs": "^6.4.0",
"#react-navigation/core": "^5.16.1",
"#react-navigation/native": "^6.0.13",
"#react-navigation/native-stack": "^6.9.6",
"#react-navigation/stack": "^6.3.1",
"#rematch/core": "^2.0.0",
"#rematch/loading": "^2.0.0",
"#sentry/react-native": "^2.6.2",
"#twotalltotems/react-native-otp-input": "^1.3.11",
"accordion-collapse-react-native": "^0.3.2",
"axios": "^0.20.0",
"babel-eslint": "^10.1.0",
"babel-plugin-inline-dotenv": "^1.6.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint-plugin-react-native": "^3.11.0",
"eslint-plugin-unused-imports": "^1.1.1",
"expo": "^40.0.0",
"expo-document-picker": "~8.4.1",
"expo-file-system": "~9.3.0",
"expo-location": "~10.0.0",
"expo-splash-screen": "~0.8.1",
"expo-status-bar": "~1.0.3",
"expo-web-browser": "~8.6.0",
"firebase": "^8.4.3",
"intl": "^1.2.5",
"lodash": "^4.17.20",
"lottie-ios": "3.4.0",
"lottie-react-native": "^5.1.4",
"moment": "^2.29.1",
"moment-duration-format": "^2.3.2",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prop-types": "^15.7.2",
"radio-buttons-react-native": "^1.0.4",
"react": "17.0.2",
"react-calendly": "^4.0.0",
"react-dom": "16.13.1",
"react-intl": "^5.24.6",
"react-native": "0.64.3",
"react-native-appsflyer": "6.8.2",
"react-native-background-timer": "^2.4.1",
"react-native-bootsplash": "^3.2.2",
"react-native-code-push": "^7.0.4",
"react-native-confirmation-code-field": "^6.5.1",
"react-native-date-picker": "^3.2.8",
"react-native-device-info": "^8.0.0",
"react-native-dotenv": "^2.5.0",
"react-native-fast-image": "^8.5.11",
"react-native-fbsdk-next": "^4.2.0",
"react-native-fingerprint-scanner": "^6.0.0",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-image-header-scroll-view": "^0.10.3",
"react-native-image-picker": "~4.2.1",
"react-native-in-app-review": "^4.1.1",
"react-native-inappbrowser-reborn": "^3.5.1",
"react-native-indicators": "^0.17.0",
"react-native-insta-story": "^1.1.8",
"react-native-keyboard-aware-scroll-view": "^0.9.2",
"react-native-linear-gradient": "^2.6.2",
"react-native-modal": "^13.0.0",
"react-native-offline": "^6.0.0",
"react-native-otp-autocomplete": "^1.0.7",
"react-native-pager-view": "5.4.12",
"react-native-paper": "^4.2.0",
"react-native-permissions": "^3.0.0",
"react-native-picker-select": "^8.0.0",
"react-native-play-install-referrer": "^1.1.8",
"react-native-popup-menu": "^0.15.11",
"react-native-portal": "^1.3.0",
"react-native-progress": "^4.1.2",
"react-native-push-notification": "7.3.1",
"react-native-quiz-maker": "^0.1.0",
"react-native-raw-bottom-sheet": "^2.2.0",
"react-native-razorpay": "^2.2.7",
"react-native-reanimated": "~2.5.0",
"react-native-responsive-fontsize": "^0.5.1",
"react-native-restart": "^0.0.22",
"react-native-rss-parser": "https://github.com/adityabishtedu/react-native-rss-parser/tarball/rss-patch",
"react-native-safe-area-context": "3.4.1",
"react-native-screens": "^3.17.0",
"react-native-session-stats": "https://github.com/balazsherczeg/react-native-session-stats.git",
"react-native-shadow-2": "^6.0.5",
"react-native-share": "^7.9.0",
"react-native-signature-canvas": "^4.3.0",
"react-native-simple-toast": "^1.1.3",
"react-native-skeleton-placeholder": "^5.0.0",
"react-native-snap-carousel": "4.0.0-beta.6",
"react-native-step-indicator": "^1.0.3",
"react-native-steps": "^1.3.0",
"react-native-svg": "^12.1.1",
"react-native-tab-view": "^3.1.1",
"react-native-tab-view-fixed": "^0.0.69",
"react-native-thumbnail-video": "^0.1.2",
"react-native-tracking-transparency": "^0.1.1",
"react-native-ultimate-config": "3.4.2",
"react-native-unimodules": "~0.12.0",
"react-native-vector-icons": "^9.1.0",
"react-native-video": "^5.1.1",
"react-native-view-shot": "^3.4.0",
"react-native-walkthrough-tooltip": "^1.1.11",
"react-native-web": "~0.13.12",
"react-native-webp-format": "^1.1.2",
"react-native-webview": "^11.18.1",
"react-native-youtube-iframe": "^2.2.2",
"react-navigation": "^4.4.4",
"react-number-format": "^4.4.1",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"redux-axios-middleware": "^4.0.1",
"redux-thunk": "^2.3.0",
"rn-faded-scrollview": "^1.0.12",
"rn-fetch-blob": "^0.12.0",
"validate.js": "^0.13.1",
"victory-native": "^36.6.0",
"volkeno-react-native-quiz-multiple-choice": "^1.0.3"
},
"devDependencies": {
"#babel/core": "^7.20.5",
"#babel/runtime": "^7.20.6",
"#babel/preset-typescript": "^7.16.5",
"#commitlint/cli": "^17.0.3",
"#commitlint/config-conventional": "^17.0.3",
"babel-jest": "~26.6.3",
"babel-loader": "^8.2.2",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-expo": "8.3.0",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "3.3.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.26.0",
"husky": "^8.0.0",
"jest": "~26.6.3",
"metro-react-native-babel-preset": "^0.73.4",
"prettier": "^2.4.1",
"react-native-bundle-visualizer": "^2.2.1",
"react-test-renderer": "17.0.1"
},
"jest": {
"preset": "react-native"
}
}
Unfortunately, I've had the same issue and so I stumbled over your question. After some hours I found the problem and the solution.
In my case the issue happened when I upgraded jest from 27 to 28 (https://jestjs.io/docs/28.x/upgrading-to-jest28) because of this change:
Babel config
babel-jest now passes root: config.rootDir to Babel when resolving configuration. This improves compatibility when using projects with differing configuration, but
it might mean your babel config isn't picked up in the same way anymore. You can override this option by passing options to babel-jest in your configuration.
My babel.config.js was located in my react native application root .\babel.config.js but my .\jest.config.js file defined as root (to search for the tests): rootDir: "src". With the change from 27 to 28 the babel.config.js file was not longer found because babel-jest searched in ./src/babel.config.js and thus exactly the same error occurred like you described above:
SyntaxError: /node_modules/#react-native/polyfills/error-guard.js: Missing semicolon. (14:4)
because babel no longer transpiled the error-guard.js file.
As you have still jest 26 (in your package.json) your case might be different - but the problem is that your babel.config.js file is not or no longer found and thus babel-jest is no longer transpiling any file.
Not sure if this helps you - I used the following solution:
Create a new file ./babel-jest.js with the content
module.exports = require("babel-jest").createTransformer({
rootMode: "upward",
})
Reference this in .\jest.config.js like:
transform: {
"^.+\\.jsx?$": "../babel-jest.js",
},
Now, instead of babel-jest directly the new transformer from .\src\..\babe-jest.js is called including the option to search for the babel.config.js file upwards (and then finally finding it in .\babel.config.js just one level above).
This solution is also described here:
Babel: root programmatic options
and here
https://github.com/facebook/jest/issues/8006
There are other proposals to use:
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { rootMode: 'upward' }],
},
in
https://github.com/facebook/jest/issues/8006
and even on the jest page it self
https://jestjs.io/docs/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object
but unfortunately this was not working for me.
There is another option you can give a try (described also in https://github.com/facebook/jest/issues/8006).
You can create a babel.config.js file in the root for your tests and reference the original file via
module.exports = require('../babel.config.js');
Hope this helps a bit.
Npm run serve is not working after I freshly installed npm in the project folder. I am using the latest webpack. Also tried uninstalling and installing npm gloabally. Though this was running before npm install. Nothing has changes in package.json since begining. I don't have idea whats going wrong here. Gives error below
at checkResourceSource (E:\projects\project-emr\emr\node_modules#vue\cli-service\node_modules\webpack\lib\RuleSet.js:167:11)
{
"dependencies": {
"#fortawesome/fontawesome-free": "^5.11.2",
"#toast-ui/vue-calendar": "^1.1.1",
"animate.css": "^3.7.2",
"auth0-js": "^9.12.2",
"autoprefixer": "latest",
"axios": "^0.19.2",
"bootstrap-vue": "^2.1.0",
"cache-loader": "^4.1.0",
"classnames": "2.2.6",
"core-js": "^3.3.2",
"css-loader": "^3.2.0",
"highcharts": "^8.0.0",
"highcharts-vue": "^1.3.5",
"instantsearch.css": "^7.3.1",
"instantsearch.js": "^3.6.0",
"jquery": "^3.4.1",
"js-cookie": "^2.2.1",
"lodash": "latest",
"lottie-web": "^5.5.10",
"material-design-icons-iconfont": "^6.1.0",
"moment": "^2.24.0",
"node-snackbar": "^0.1.16",
"postcss-loader": "^3.0.0",
"ramda": "^0.26.1",
"register-service-worker": "^1.6.2",
"smooth-scrollbar": "^8.5.1",
"swiper": "^5.3.0",
"url-loader": "^3.0.0",
"vee-validate": "^3.2.2",
"vue": "^2.6.10",
"vue-class-component": "^7.2.3",
"vue-file-agent": "^1.7.3",
"vue-flatpickr-component": "^8.1.5",
"vue-form-wizard": "^0.8.4",
"vue-i18n": "^8.15.3",
"vue-instantsearch": "^2.6.0",
"vue-morris": "^1.1.0",
"vue-photo-grid": "^1.0.2",
"vue-property-decorator": "^8.3.0",
"vue-resource": "^1.5.1",
"vue-router": "^3.1.3",
"vue-select": "^3.4.0",
"vue-slick": "^1.1.15",
"vue-slider-component": "3.0.32",
"vuedraggable": "^2.23.2",
"vuefire": "^2.2.1",
"vuetify": "^2.3.10",
"vuex": "^3.0.1",
"webpack": "latest",
"wowjs": "^1.1.3"
},
"devDependencies": {
"#babel/polyfill": "^7.7.0",
"#fullcalendar/list": "^4.3.0",
"#mdi/font": "^5.6.55",
"#vue/cli-plugin-babel": "~4.1.0",
"#vue/cli-plugin-eslint": "^4.1.0",
"#vue/cli-plugin-pwa": "^4.1.2",
"#vue/cli-plugin-router": "^4.1.0",
"#vue/cli-plugin-vuex": "^4.1.0",
"#vue/cli-service": "^4.1.0",
"#vue/eslint-config-standard": "^4.0.0",
"babel-eslint": "^10.0.3",
"bootstrap": "^4.3.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"less": "^3.10.3",
"less-loader": "^5.0.0",
"lint-staged": "^9.5.0",
"mutationobserver-shim": "^0.3.3",
"node-sass": "^4.13.1",
"popper.js": "^1.16.0",
"portal-vue": "^2.1.6",
"sass": "^1.19.0",
"sass-loader": "^8.0.0",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.2",
"vue-cli-plugin-bootstrap-vue": "^0.6.0",
"vue-cli-plugin-i18n": "~0.6.1",
"vue-clipboard2": "^0.3.1",
"vue-loader": "^15.7.2",
"vue-template-compiler": "^2.6.10"
}
I'm trying to migrate to the last vue-styleguidist but since v4.0.0 i can't.
With the 3.26.2 it's working fine.
I have this error :
(node:11764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
There is a guide for the migration?
It's very strange since the babel typescript snafu everything is fine, maybe i need to add something inside babel configuration?
i'm working with :
NodeJS 10.15.1
My dependencies :
"dependencies": {
"async-validator": "^1.12.2",
"cleave.js": "^1.5.3",
"color": "^3.1.2",
"ie11-custom-properties": "^2.3.0",
"interactjs": "^1.7.2",
"lodash": "^4.17.15",
"lodash.orderby": "^4.6.0",
"mobile-device-detect": "^0.2.3",
"normalize-wheel": "^1.0.1",
"portal-vue": "^1.5.1",
"throttle-debounce": "^1.0.1",
"vue": "^2.6.10",
"vue-avatar": "^2.1.8",
"vue-i18n": "^7.4.1",
"vue-infinite-scroll": "^2.0.2",
"vue-lorem-ipsum": "0.0.1",
"vue-router": "^3.1.3",
"vue-styleguidist": "4.0.3",
"vue-svgicon": "^2.1.3",
"vuebar": "^0.0.20"
},
"devDependencies": {
"#babel/core": "^7.7.4",
"#vue/babel-preset-app": "^3.12.1",
"#vue/cli-plugin-babel": "^3.12.1",
"#vue/cli-plugin-unit-jest": "^3.12.1",
"#vue/cli-service": "^3.12.1",
"#vue/test-utils": "^1.0.0-beta.29",
"autoprefixer": "^8.2.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^8.2.2",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^22.4.4",
"babel-loader": "^8.0.6",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-polyfill": "^6.26.0",
"cheerio": "^1.0.0-rc.3",
"connect-history-api-fallback": "^1.6.0",
"cross-env": "^5.2.1",
"css-loader": "^0.28.9",
"deepmerge": "^2.0.1",
"eslint": "^4.16.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-import-resolver-webpack": "^0.8.4",
"eslint-loader": "^2.2.1",
"eslint-plugin-html": "^4.0.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-vue": "^4.4.0",
"express": "^4.17.1",
"favicons-webpack-plugin": "0.0.8",
"file-loader": "^1.1.11",
"highlight.js": "^9.16.2",
"html-webpack-plugin": "^3.1.0",
"http-proxy-middleware": "^0.18.0",
"jest": "^24.9.0",
"jest-cucumber": "^2.0.11",
"jest-html-reporters": "^1.2.0",
"jest-serializer-vue": "^2.0.2",
"json-loader": "^0.5.7",
"markdown-it": "^8.4.0",
"markdown-it-container": "^2.0.0",
"mini-css-extract-plugin": "^0.2.0",
"node-sass": "^4.13.0",
"nodemon": "^1.19.4",
"normalize.css": "^8.0.0",
"npm-run-all": "^4.1.2",
"ora": "^2.0.0",
"postcss-loader": "^2.0.10",
"postcss-url": "^7.3.0",
"raw-loader": "^0.5.1",
"resolve-url-loader": "^2.3.2",
"sass-loader": "^6.0.6",
"shelljs": "^0.8.1",
"style-loader": "^0.20.3",
"ts-jest": "^24.2.0",
"tslint": "^5.20.1",
"typescript": "^3.7.2",
"url-loader": "^1.0.1",
"vue-clipboards": "^1.3.0",
"vue-html-loader": "^1.2.4",
"vue-jest": "^3.0.5",
"vue-loader": "^14.2.4",
"vue-markdown-loader": "^2.4.0",
"vue-server-renderer": "^2.6.10",
"vue-style-loader": "^4.1.0",
"vue-template-compiler": "^2.6.10",
"webpack": "^4.41.2",
"webpack-bundle-analyzer": "^2.9.2",
"webpack-cli": "^3.3.10",
"webpack-dashboard": "^1.1.1",
"webpack-dev-middleware": "^3.7.2",
"webpack-hot-middleware": "^2.25.0",
"webpack-merge": "^4.2.2",
"yaml-loader": "^0.5.0"
}
I have a project which has a rails backend a Vue frontend. I have everything working between the two ends, and now I'm trying to add Vuetify to make it look nicer.
I ran vue install vuetify and got
Running completion hooks... ERROR Error: ENOENT: no such file or directory, open './draw-front/public/index.html'
Error: ENOENT: no such file or directory, open './draw-front/public/index.html'
So, instead I tried adding manually via the guide on the vuetify website, but whichever method I use I get errors that there is no appropriate handler for the components
error in ./node_modules/vuetify/lib/components/VCombobox/VCombobox.js
Module parse failed: Unexpected token (69:44)
You may need an appropriate loader to handle this file type.
|
| if (this.multiple) {
| chip.componentOptions.listeners = { ...chip.componentOptions.listeners,
| dblclick: () => {
| this.editingIndex = index;
# ./node_modules/vuetify/lib/components/VCombobox/index.js 1:0-36
# ./node_modules/vuetify/lib/components/index.js
# ./node_modules/vuetify/lib/index.js
# ./src/plugins/vuetify.js
# ./src/main.js
# multi (webpack)-dev-server/client?http://localhost:5106 webpack/hot/dev-server ./src/main.js
There are similar errors for about 20 different components, and in the browser I just get Cannot GET /
Versions:
#vue/cli 4.1.2
Rails 6.0.2.1
ruby 2.6.5p114
Dependencies
"dependencies": {
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuetify": "^2.1.0"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^8.2.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-istanbul": "^4.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",
"chai": "^4.1.2",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^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.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.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",
"inject-loader": "^3.0.0",
"karma": "^1.4.1",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-phantomjs-shim": "^1.4.0",
"karma-sinon-chai": "^1.3.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.31",
"karma-webpack": "^2.0.2",
"mocha": "^3.2.0",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"phantomjs-prebuilt": "^2.1.14",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"sass": "^1.19.0",
"sass-loader": "^8.0.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"sinon": "^4.0.0",
"sinon-chai": "^2.8.0",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-cli-plugin-vuetify": "^2.0.3",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"vuetify-loader": "^1.3.0",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
What year did you create your Vue.js project? Your package.json look like old and Vuetify Installation need your project updated.
I recommend that you create a new project with Vue CLI (with last version), install Vuetify and then migrate your files from the old project for the new project.
It's seems a hard work, but is very simple.
Use also the last version of Node.js.
I'm trying to use Jest with VueJS, however I'm getting Cannot find module 'babel-core' at Object.<anonymous> (node_modules/vue-jest/lib/compilers/babel-compiler.js:1:15).
The only way I could fix this was adding
"#babel/core": "^7.7.5",
"babel-core": "^7.0.0-beta.47",
Then test pass, but I do not want to keep the 'beta' version in my package.json, and it is weird to have #babel/core and babel-core together, knowing they are the same package in different versions.
I see the error seems to be in Vue-Jest, but it is already in last version.
Below is my current package.json that breaks (without "babel-core": "^7.0.0-beta.47")
"dependencies": {
"#vue/babel-preset-app": "^3.12.1",
"axios": "^0.19.0",
"chai": "^4.2.0",
"date-fns": "^1.30.1",
"jwt-decode": "^2.2.0",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"register-service-worker": "^1.5.2",
"v-click-outside": "^2.1.5",
"vue": "^2.6.10",
"vue-alertify": "^1.1.0",
"vue-body-class": "^2.0.0-beta.2",
"vue-clipboard2": "^0.3.1",
"vue-mq": "^0.1.3",
"vue-multiselect": "^2.1.6",
"vue-recaptcha-v3": "^1.8.0",
"vue-router": "^3.1.3",
"vue-the-mask": "^0.11.1",
"vuelidate": "^0.7.4",
"vuex": "^3.1.2",
"vuex-persist": "^2.2.0"
},
"devDependencies": {
"#babel/core": "^7.7.5",
"#babel/plugin-transform-modules-commonjs": "^7.7.5",
"#babel/polyfill": "^7.7.0",
"#babel/preset-env": "^7.7.5",
"#vue/cli-plugin-babel": "^3.12.1",
"#vue/cli-plugin-eslint": "^3.12.1",
"#vue/cli-plugin-pwa": "^3.12.1",
"#vue/cli-service": "^3.12.1",
"#vue/eslint-config-standard": "^4.0.0",
"#vue/test-utils": "^1.0.0-beta.30",
"babel-eslint": "^10.0.3",
"copy-webpack-plugin": "^5.0.5",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.2.3",
"eslint-plugin-vue-libs": "^3.0.2",
"jest": "^24.9.0",
"vue-jest": "^3.0.5",
"vue-svg-loader": "^0.12.0",
"vue-template-compiler": "^2.6.10"
}
Any help would be appreciated.
just use babel-bridge . from github issue
npm install babel-core#^7.0.0-bridge.0 --save-dev