Browser Extensions Cause "Cannot redefine property: Shopify" Error
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 443
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 24
Description
What is the location of your example repository?
https://github.com/Shopify/hydrogen/tree/main/templates/skeleton
Which package or tool is having this issue?
Hydrogen
What version of that package or tool are you using?
2026.1.0
What version of Remix are you using?
7.12.0
Steps to Reproduce
- Install Urban VPN browser extension (note that this is only one example, there could be more extensions)
- Visit any Hydrogen store (e.g., https://skeleton.hydrogen.shop/)
- Open browser developer console
- Observe
TypeError: Cannot redefine property: Shopifyerror - Notice the app crashes/becomes unusable (The Remix/RR error boundary kicks in)
Expected Behavior
- Framework resilience: Hydrogen apps should not crash regardless of which browser extensions users have installed
- Defensive coding: The logic in ShopifyCustomerPrivacy.tsx:344 should check if
window.Shopifyis already defined and handle both configurable and non-configurable scenarios gracefully - Consistent experience: Hydrogen should provide the same level of stability as Shopify Theme stores when dealing with third-party scripts
- Graceful degradation: If an extension conflicts with Hydrogen's property definitions, the app should continue functioning with appropriate fallback behavior
- User-first approach: End users shouldn't need to disable legitimate browser extensions to use Hydrogen stores
Actual Behavior
App becomes completely unusable with TypeError: Cannot redefine property: Shopify when browser extensions define the property as non-configurable.
Relevant resources
- https://github.com/Shopify/hydrogen/issues/2549
chrome-extension://eppiocemhmnlbhjplcgkofciiegomcon/libs/extend-native-history-api.js- ChatGPT conversation: Ad-blockers and Website Breakage
- Loom video
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash from the templates/skeleton store with the Urban VPN extension, then inspect packages/hydrogen/src/customer-privacy/ShopifyCustomerPrivacy.tsx around line 344. Review the related issue #2549 and trace how the Shopify property is defined. Done means the store remains usable when an extension defines window.Shopify as configurable or non-configurable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100