I am using React+Vite for my project. However when I am trying to build image on remote, I am getting errors. #15693
Replies: 1 comment
-
Found solution |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using React+Vite for my project. However when I am trying to build image on remote, I am getting errors:
vite --config vite.config.ts --host
failed to load config from /usr/src/app/vite.config.ts
error when starting dev server:
Error: EACCES: permission denied, open '/usr/src/app/vite.config.ts.timestamp-1289078295637-df1b4d899e260.mjs'
package.json:
{ "name": "project", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite --config vite.config.ts --host", "build": "tsc && vite build", "preview": "vite preview", "husky:prepare": "npx husky install", "prettier": "prettier --check \"./src/**/*.+(ts|tsx|scss)\"", "prettier-fix": "npx prettier --write \"./src/**/*.+(ts|tsx|scss)\"", "lint:styles": "npx stylelint \"**/*.scss\"", "lint:styles-fix": "npx stylelint \"**/*.scss\" --fix", "lint:ts": "tsc && eslint --quiet \"./src/**/*.+(ts|tsx)\"", "lint:ts-fix": "tsc && eslint \"./src/**/*.+(ts|tsx)\" --fix", "test": "vitest run", "test:watch": "vitest --watch", "test:ui": "vitest --watch --ui", "test:ci": "vitest run --coverage" }, "dependencies": { "@reduxjs/toolkit": "^1.9.7", "@types/axios": "^0.14.0", "axios": "^1.6.2", "classnames": "^2.3.2", "moment": "^2.29.4", "pdfjs-dist": "^4.0.269", "react": "^18.2.0", "react-dom": "^18.2.0", "react-icons": "^4.12.0", "react-pdf-highlighter": "^6.1.0", "react-redux": "^8.1.3", "react-router-dom": "^6.14.0" }, "devDependencies": { "@testing-library/jest-dom": "^6.1.3", "@testing-library/react": "^14.0.0", "@types/node": "^18.17.1", "@types/react": "^18.2.39", "@types/react-dom": "^18.2.7", "@types/react-router-dom": "^5.3.3", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "@vitejs/plugin-react": "^4.1.0", "@vitest/coverage-istanbul": "^0.34.6", "@vitest/ui": "^0.34.6", "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-check-file": "^2.6.2", "eslint-plugin-import": "^2.28.1", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "husky": "^8.0.3", "jsdom": "^22.1.0", "prettier": "^3.1.0", "sass": "^1.68.0", "stylelint": "^15.10.3", "stylelint-config-standard-scss": "^11.0.0", "stylelint-order": "^6.0.3", "typescript": "^5.0.4", "vite": "^4.5.0", "vite-tsconfig-paths": "^4.2.1", "vitest": "^0.34.6" } }
tsconfig.json:
{ "compilerOptions": { "target": "ESNext", "useDefineForClassFields": true, "lib": ["DOM", "DOM.Iterable", "ESNext"], "allowJs": false, "skipLibCheck": true, "esModuleInterop": false, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "module": "ESNext", "moduleResolution": "Node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "baseUrl": "./", "paths": { "@api/*": ["src/api/*"], "@core/*": ["src/core/*"], "@data/*": ["src/data/*"], "@features/*": ["src/features/*"], "@hooks/*": ["src/hooks/*"], "@routes/*": ["src/routes/*"], "@components/*": ["src/components/*"], "@pages/*": ["src/pages/*"], "@model/*": ["src/model/*"], "@services/*": ["src/services/*"], "@store/*": ["src/store/*"], "@styles/*": ["src/styles/*"], "@utils/*": ["src/utils/*"], "@scssCore/*": ["src/styles/core/*"] } }, "include": ["src", "typings.d.ts", "./testSetup.ts"], "references": [{ "path": "./tsconfig.node.json" }] }
vite.config.ts:
`
import * as path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
plugins: [react(), tsconfigPaths()],
resolve: {
alias: {
'@Styles': path.join(__dirname, './src/styles/'),
'@assets': path.join(__dirname, './src/assets/'),
'@scssCore': path.join(__dirname, './src/styles/core/'),
},
},
server: {
host: '10.226.52.102',
watch: {
usePolling: true,
},
port: 3000,
},
css: {
devSourcemap: true,
},
});
`
Beta Was this translation helpful? Give feedback.
All reactions