heroku にblitz.jsで作ったアプリをデプロイする際にエラーが出ました。
heroku logs でエラー内容を確認してみると、package.JSONのdependenciesにはreactが載っているにもかかわらず、「The module 'react' was not found. Blitz.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install react'」と表示されます。
<試したこと>
一度reactをuninstall してもう一度install したが変化がなかった。
json
1{ 2 "name": "blitz", 3 "version": "1.0.0", 4 "scripts": { 5 "dev": "blitz dev", 6 "build": "blitz build", 7 "start": "blitz start", 8 "start:production": "blitz start --port $PORT", 9 "studio": "blitz prisma studio", 10 "lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .", 11 "test": "jest", 12 "test:watch": "jest --watch" 13 }, 14 "prisma": { 15 "schema": "db/schema.prisma" 16 }, 17 "prettier": { 18 "semi": false, 19 "printWidth": 100 20 }, 21 "lint-staged": { 22 "*.{js,ts,tsx}": [ 23 "eslint --fix" 24 ] 25 }, 26 "dependencies": { 27 "@fortawesome/fontawesome-svg-core": "1.2.35", 28 "@fortawesome/free-solid-svg-icons": "5.15.3", 29 "@fortawesome/react-fontawesome": "0.1.14", 30 "@prisma/client": "2.26.0", 31 "@tailwindcss/line-clamp": "0.2.1", 32 "axios": "0.21.1", 33 "blitz": "0.38.2", 34 "final-form": "4.20.2", 35 "passport-github": "1.1.0", 36 "passport-google-oauth2": "0.2.0", 37 "pg": "8.6.0", 38 "react": "17.0.2", 39 "react-dom": "17.0.2", 40 "react-final-form": "6.5.3", 41 "react-intersection-observer": "8.32.0", 42 "react-loading": "2.0.3", 43 "react-transition-group": "4.4.2", 44 "recoil": "0.3.1", 45 "xmljson": "0.2.0", 46 "zod": "3.3.4" 47 }, 48 "devDependencies": { 49 "@types/preview-email": "2.0.0", 50 "@types/react": "17.0.13", 51 "autoprefixer": "10.2.6", 52 "eslint": "7.30.0", 53 "husky": "6.0.0", 54 "lint-staged": "10.5.4", 55 "prettier": "2.3.2", 56 "prettier-plugin-prisma": "0.13.2", 57 "pretty-quick": "3.1.1", 58 "preview-email": "3.0.4", 59 "prisma": "2.26.0", 60 "tailwindcss": "2.2.4", 61 "typescript": "~4.3" 62 }, 63 "private": true 64}
協力よろしくお願いします。
あなたの回答
tips
プレビュー