andrezimpel / gatsby-plugin-gdpr-cookies

Gatsby plugin to add Google Analytics (V4 is supported), Google Tag Manager, Facebook Pixel, TikTok Pixel and Hotjar in a GDPR form to your site.
Apache License 2.0
101 stars 70 forks source link

1.0.12 breaks with react 17.x #38

Closed axelra82 closed 3 years ago

axelra82 commented 3 years ago

Works

...
"gatsby": "^2.29.3",
"gatsby-plugin-gdpr-cookies": "^1.0.11",
"react": "^17.0.1",
"react-dom": "^17.0.1",
...

While

...
"gatsby": "^2.29.3",
"gatsby-plugin-gdpr-cookies": "^1.0.12",
"react": "^17.0.1",
"react-dom": "^17.0.1",
...

produces the following error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: ar-supplements@0.1.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"^16.4.2 || ^17.0.0" from gatsby@2.32.8
npm ERR!   node_modules/gatsby
npm ERR!     gatsby@"^2.29.3" from the root project
npm ERR!     peer gatsby@"^2.24.77" from gatsby-plugin-gdpr-cookies@1.0.12
npm ERR!     node_modules/gatsby-plugin-gdpr-cookies
npm ERR!       gatsby-plugin-gdpr-cookies@"^1.0.12" from the root project
npm ERR!   1 more (react-dom)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.13.1" from gatsby-plugin-gdpr-cookies@1.0.12
npm ERR! node_modules/gatsby-plugin-gdpr-cookies
npm ERR!   gatsby-plugin-gdpr-cookies@"^1.0.12" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Any suggestions for a quick fix? Tried adding 17.x to peerDependencies, didn't help:

...
"peerDependencies": {
    "gatsby": "^2.24.77",
    "react": "^16.13.1 || ^17.x",
    "react-dom": "^16.13.1 || ^17.x"
  },
...
andrezimpel commented 3 years ago

I have a look at this!

andrezimpel commented 3 years ago

This will be fixed in 2.0. You might wanna give 2.0 a test drive @axelra82?

axelra82 commented 3 years ago

This will be fixed in 2.0. You might wanna give 2.0 a test drive @axelra82?

Will test this tonight or tomorrow morning and report back 👍

axelra82 commented 3 years ago

Sorry for the late reply... everything seems to be working fine now! 👍