How Connect a separate (JS component Bootstrap 5) in NuxtJS - vue.js

I have Bootstrap5 installed, I only want to include a few components from Bootstrap5 sources, how do I do that?
package.json
{
"name": "Blog",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"#nuxtjs/svg": "^0.3.0",
"bootstrap": "^5.1.3",
"core-js": "^3.19.3",
"nuxt": "^2.15.8",
"vue": "^2.6.14",
"vue-server-renderer": "^2.6.14",
"vue-template-compiler": "^2.6.14",
"webpack": "^4.46.0"
},
"devDependencies": {
"pug": "^3.0.2",
"pug-plain-loader": "^1.1.0",
"sass": "^1.47.0",
"sass-loader": "^10.2.0"
}
}

Related

Nuxt hot reload not working when i want change a nuxt page

I have a nuxt project. When i want to change a page file hot reload is not complete and for next changes hot reload not working.
My packages:
{
"name": "my-project",
"version": "1.0.0",
"private": true,
"scripts": {
"app_panel:dev": "nuxt ./app_panel",
"app_panel:build": "nuxt ./app_panel build",
"app_panel:start": "nuxt ./app_panel start",
"app_panel:generate": "nuxt ./app_panel generate",
"app_panel:test": "jest --config=app_panel/jest.config.js"
},
"dependencies": {
"#nuxtjs/auth-next": "5.0.0-1624817847.21691f1",
"#nuxtjs/axios": "^5.13.6",
"#nuxtjs/i18n": "^7.0.2",
"core-js": "^3.15.1",
"nuxt": "^2.15.8"
},
"devDependencies": {
"#nuxt/test-utils": "^0.2.2",
"#nuxtjs/dotenv": "^1.4.1",
"#nuxtjs/tailwindcss": "^4.2.1",
"#vue/test-utils": "^1.2.1",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^27.0.5",
"eslint": "^7.32.0",
"eslint-plugin-nuxt": "^2.0.0",
"jest": "^27.1.1",
"node-sass": "^4.14.1",
"postcss": "^8.3.5",
"sass-loader": "^10.1.1",
"video.js": "^7.14.3",
"vue-jest": "^3.0.4"
},
"resolutions": {
"ignore": "4.0.6"
}
}

react native eslint pre-commit does not work

I want to enforce eslint rules before commit and I have configured pre-commit in react-native package.js file but it is not showing eslint error on commit. if I run yar run lint works fine.
Below is my Package.js file
{
"name": "test",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "17.0.2",
"react-native": "0.65.1",
"storyblok-js-client": "^4.0.9",
"react-query": "^3.19.1",
"react-redux": "^7.2.4",
"graphql": "^15.5.0",
"graphql-request": "^3.5.0",
"react-native-typography": "^1.4.1",
"rn-fetch-blob": "^0.12.0",
"react-native-webview": "^11.13.0",
"base-64": "^1.0.0"
},
"devDependencies": {
"#babel/core": "^7.15.5",
"#babel/runtime": "^7.15.4",
"#react-native-community/eslint-config": "^3.0.1",
"#typescript-eslint/eslint-plugin": "^4.31.1",
"#typescript-eslint/parser": "^4.31.1",
"babel-jest": "^27.2.0",
"eslint": "^7.32.0",
"eslint-plugin-react": "^7.25.1",
"jest": "^27.2.0",
"metro-react-native-babel-preset": "^0.66.2",
"react-native-codegen": "^0.0.7",
"react-test-renderer": "17.0.2",
"#testing-library/react-native": "^7.2.0",
"eslint-plugin-jest": "^24.4.0",
"fetch-mock": "^9.11.0",
"husky": "^7.0.2",
"lint-staged": "^11.1.2",
"typescript-styled-plugin": "^0.18.1"
},
"lint-staged": {
"src/**/*.{ts,tsx, js, jsx}": [
"eslint --ext .tsx --ext .ts src/ --fix"
],
"./src/**": [
"prettier --write ."
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged && pretty-quick --staged"
},
"jest": {
"preset": "react-native"
}
}
}
Did you run husky install?
You can also try to add a file named 'pre-commit' to the .husky folder with the following content:
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged

Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) in FabricJs

I use fabric.js in my project and I got this error Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) when I build my project. Please help me, how to resolve it.
my package.json
{
"name": "my-project",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"test": "jest"
},
"dependencies": {
"fabric": "^4.2.0",
"nodemon": "^2.0.4",
"nuxt": "^2.13.3",
"nuxt-i18n": "^6.13.8",
"sqlite3": "^5.0.0",
"vue-axios": "^2.1.5",
},
"devDependencies": {
"#vue/test-utils": "^1.0.3",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^26.0.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"jest": "^26.0.1",
"prettier": "^2.0.5",
"vue-jest": "^3.0.4"
}
}

Module exists in package.json but not found on firebase

I have a module in my nextjs project which is mentioned under dependencies in package.json. It works locally. But when I build and deploy to firebase function I get the following error
Cannot find module 'react-lazyload'
My package.json
{
"name": "ui",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"export": "next export",
"predeploy": "next build",
"deploy": "firebase use popcorntales-40767 & firebase deploy"
},
"engines": {
"node": "10"
},
"dependencies": {
"#material-ui/core": "^4.11.0",
"#material-ui/icons": "^4.9.1",
"#material-ui/lab": "^4.0.0-alpha.56",
"#zeit/next-css": "^1.0.1",
"bootstrap": "^4.5.0",
"cacheable-response": "^2.1.0",
"chart.js": "^2.9.3",
"firebase-admin": "^8.10.0",
"firebase-functions": "^3.6.1",
"next": "9.4.4",
"prop-types": "^15.7.2",
"react": "16.13.1",
"react-bootstrap": "^1.0.1",
"react-chartkick": "^0.4.0",
"react-dom": "16.13.1",
"react-lazyload": "^3.0.0",
"react-responsive-carousel": "^3.2.9",
"react-share": "^4.2.0"
},
"devDependencies": {
"firebase-functions-test": "^0.2.0"
}
}
Commands used
1) next build
2) firebase deploy

Electron builder not packing module?

Hi all I'm working on an app that uses vue + electron builder,
but for some reason one of my modules (#wuild/vue-electron-ipc) cannot be found after packaging for production and I'm getting the following error
Uncaught Error: Cannot find module '#wuild/vue-electron-ipc'
Here is my package.json
"name": "bla",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"electron:build": "vue-cli-service electron:build",
"electron:serve": "vue-cli-service electron:serve",
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps",
},
"main": "./background.js",
"dependencies": {
"#wuild/vue-electron-ipc": "^1.0.3",
"apexcharts": "^3.19.2",
"axios": "^0.19.2",
"body-parser": "^1.19.0",
"core-js": "^3.6.5",
"cors": "^2.8.5",
"createjs": "^1.0.1",
"electron-window-manager": "^1.0.6",
"express": "^4.17.1",
"express-vue": "^5.15.1",
"http": "0.0.1-security",
"jquery": "^3.5.1",
"jquery-ui": "^1.12.1",
"jsonfile": "^2.4.0",
"morgan": "^1.10.0",
"sequelize": "^5.21.13",
"socket.io": "^2.3.0",
"vue": "^2.6.11",
"vue-apexcharts": "^1.5.3",
"vue-electron": "^1.0.6"
},
"devDependencies": {
"#vue/cli-plugin-babel": "~4.4.0",
"#vue/cli-plugin-eslint": "~4.4.0",
"#vue/cli-service": "~4.4.0",
"babel-eslint": "^10.1.0",
"electron": "^9.0.0",
"electron-packager": "^14.2.1",
"electron-rebuild": "^1.11.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-cli-plugin-electron-builder": "~2.0.0-rc.1",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
Can someone please help me?