fullstackreact/google-maps-react

Support react 17?

sue445 opened this issue · 2 comments

I want to upgrade react-dom from 16.14.0 to 17.0.2, build is failed in google-maps-react.

package.json
{
  "dependencies": {
    "google-maps-react": "^2.0.6",
    "react": "^17.0.2",
    "react-dom": "^17.0.2"
  }
}

ref. https://github.com/sue445/primap/blob/f5d7fddaa671c1258fed11b64a1a2b0a7f9d1af7/frontend/package.json

Error log
$ Run npm run build

> primap-frontend@0.0.0 build /home/runner/work/primap/primap/frontend
> webpack

ERROR in ./node_modules/google-maps-react/dist/components/Circle.js
Module not found: Error: Can't resolve 'prop-types' in '/home/runner/work/primap/primap/frontend/node_modules/google-maps-react/dist/components'
 @ ./node_modules/google-maps-react/dist/index.js
 @ ./app/components/MapContainer.tsx 41:26-54
 @ ./app/app.tsx 35:37-73

ERROR in ./node_modules/google-maps-react/dist/components/HeatMap.js
Module not found: Error: Can't resolve 'prop-types' in '/home/runner/work/primap/primap/frontend/node_modules/google-maps-react/dist/components'
 @ ./node_modules/google-maps-react/dist/index.js
 @ ./app/components/MapContainer.tsx 41:26-54
 @ ./app/app.tsx 35:37-73

ERROR in ./node_modules/google-maps-react/dist/components/InfoWindow.js
Module not found: Error: Can't resolve 'prop-types' in '/home/runner/work/primap/primap/frontend/node_modules/google-maps-react/dist/components'
 @ ./node_modules/google-maps-react/dist/index.js
 @ ./app/components/MapContainer.tsx 41:26-54
 @ ./app/app.tsx 35:37-73

ERROR in ./node_modules/google-maps-react/dist/components/Marker.js
Module not found: Error: Can't resolve 'prop-types' in '/home/runner/work/primap/primap/frontend/node_modules/google-maps-react/dist/components'
 @ ./node_modules/google-maps-react/dist/index.js
 @ ./app/components/MapContainer.tsx 41:26-54
 @ ./app/app.tsx 35:37-73

ERROR in ./node_modules/google-maps-react/dist/components/Polygon.js
Module not found: Error: Can't resolve 'prop-types' in '/home/runner/work/primap/primap/frontend/node_modules/google-maps-react/dist/components'
 @ ./node_modules/google-maps-react/dist/index.js
 @ ./app/components/MapContainer.tsx 41:26-54
 @ ./app/app.tsx 35:37-73

ERROR in ./node_modules/google-maps-react/dist/components/Polyline.js
Module not found: Error: Can't resolve 'prop-types' in '/home/runner/work/primap/primap/frontend/node_modules/google-maps-react/dist/components'
 @ ./node_modules/google-maps-react/dist/index.js
 @ ./app/components/MapContainer.tsx 41:26-54
 @ ./app/app.tsx 35:37-73

ERROR in ./node_modules/google-maps-react/dist/components/Rectangle.js
Module not found: Error: Can't resolve 'prop-types' in '/home/runner/work/primap/primap/frontend/node_modules/google-maps-react/dist/components'
 @ ./node_modules/google-maps-react/dist/index.js
 @ ./app/components/MapContainer.tsx 41:26-54
 @ ./app/app.tsx 35:37-73

ERROR in ./node_modules/google-maps-react/dist/index.js
Module not found: Error: Can't resolve 'prop-types' in '/home/runner/work/primap/primap/frontend/node_modules/google-maps-react/dist'
 @ ./app/components/MapContainer.tsx 41:26-54
 @ ./app/app.tsx 35:37-73

ref. https://github.com/sue445/primap/pull/558/checks?check_run_id=2281902162

google-maps-react doesn't seem to support react 17 yet.

"peerDependencies": {
"react": "~0.14.8 || ^15.0.0 || ^16.0.0",
"react-dom": "~0.14.8 || ^15.0.0 || ^16.0.0"
},

Do you have any plans to support react 17?

Have you tried upgrading react-dom to 17.0.2 as well? The map works in my 17.0.2 project...

Sorry. I added prop-types as devDependencies, build is successful 😅

$ npm i --save-dev prop-types

$ git diff package.json
diff --git a/frontend/package.json b/frontend/package.json
index bf3e724e..27aacaaf 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -31,6 +31,7 @@
     "postcss": "^8.2.9",
     "postcss-loader": "^5.2.0",
     "prettier": "^2.2.1",
+    "prop-types": "^15.7.2",
     "ts-jest": "^26.5.4",
     "ts-loader": "^8.1.0",
     "typescript": "^4.2.4",

sue445/primap@8d86bbe