Comments (12)
Hi,
Finally I solved the problem by updating react-scripts
from version ^4
to 5.0.0
from cookie-consent-banner.
Seems that your setup has issues with the nullish coelescing operator (??
).
What is your setup?
Are you using create-react-app
?
Which node version are you running?
from cookie-consent-banner.
Yes I am using create-react-app
Node version is v14.17.3
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| const acceptedCategoriesListener = event => {
| if (isCustomEvent(event)) {
> setAcceptedCategories(event.detail.acceptedCategories ?? []);
| }
| };
at Object../node_modules/@porscheofficial/cookie-consent-banner-react/lib/module/index.js (RefreshUtils.js:168:1)
at __webpack_require__ (bootstrap:856:1)
at fn (bootstrap:150:1)
at Module.<anonymous> (bootstrap.min.css:7:1)
at Module../src/App.js (App.js:293:1)
at __webpack_require__ (bootstrap:856:1)
at fn (bootstrap:150:1)
at Module.<anonymous> (wave.jpg:1:1)
at Module../src/index.js (index.js:17:1)
at __webpack_require__ (bootstrap:856:1)
at fn (bootstrap:150:1)
at Object.1 (utils.js:191:1)
at __webpack_require__ (bootstrap:856:1)
at checkDeferredModules (bootstrap:45:1)
at Array.webpackJsonpCallback [as push] (bootstrap:32:1)
at main.chunk.js?__WB_REVISION__=013aac3d6d7af22fde2258807dc5984e:1:59```
This is the error completely.
from cookie-consent-banner.
Which version of create-react-app
?
from cookie-consent-banner.
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-native-svg": "^12.1.1",
"react-router-dom": "^6.0.2",
"react-scripts": "4.0.3",
Actually I started to implement directly into index.html but even that seems very complicated 😅
from cookie-consent-banner.
Interesting.
Unfortunately, I'm unable to replicate the issue.
The component works fine with react-scripts v4
: https://codesandbox.io/s/vibrant-kilby-glbxj?file=/src/App.js
Would be great if you provide a codesandbox so I can figure out the issue.
Probably you have some changes in your tsconfig.js
or your webpack setup that leads to the error.
from cookie-consent-banner.
Ok I will check
from cookie-consent-banner.
Btw finally I am able to make it work on html with tag manager but cursor doesnt change into pointer over buttons.
from cookie-consent-banner.
Hi @damdafayton ! Should be fixed with v2.1.3
. Can you confirm?
from cookie-consent-banner.
Yes its fixed 👍 Thx.
from cookie-consent-banner.
Ive tried on codesandbox and it works there too. For some reason, still it doesnt work on mine. I will check another time.
The way i made it work is that i just copied the whole cookie-consent-banner
library into react's app/public
and inserted the .esm.js
file into index.html.
So it serves the purpose currently. Great library 💯
from cookie-consent-banner.
Thanks :)
from cookie-consent-banner.
Related Issues (17)
- @feature "startChecked" new property for CategoryItem HOT 1
- Absence of the consent-state cookie is not handled correctly HOT 2
- isMandatory checkbox is disabled but not checked HOT 1
- Absence of the consent-state cookie is not handled correctly HOT 4
- Upgrade to stencil v3
- Upgrade to Stencil v3
- More style flexibility
- Dark patterns are present in example image HOT 3
- Can not import react module into the app HOT 4
- Add expirationDate as property HOT 1
- Continue with technically required cookies only button doesn't unset other cookies HOT 2
- Package produces an error in older browser (ie. iOS Safari 12.4) HOT 3
- Cannot find module './cookie-consent-banner.entry.js' HOT 1
- LCP slows down by 2.2 seconds when cookie banner is shown. HOT 4
- Typescript error triggerCookieConsentBanner HOT 6
- Error when using with Vite HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cookie-consent-banner.