Comments (3)
It looks like Shopify's admin does not allow redirects to be defined with a trailing slash, so it's probably okay for us to automatically strip trailing slashes before we query for redirects. I will make this change.
from hydrogen.
@johnstew its likely a bit of both. I will report it to the API team and see if there is anything we can do on the hydrogen side for now as well.
from hydrogen.
Okay, so my workaround was to copy all the code around storefrontRedirect
and modify it to check if there's a slash at the end and remove it to query for the redirects.
const hasTrailingSlash = /\/$/.test(redirectFrom);
const modifiedRedirectFrom = hasTrailingSlash ? redirectFrom.replace(/\/$/, '') : redirectFrom;
const {urlRedirects} = await storefront.query(REDIRECT_QUERY, {
variables: {
query: `path:${modifiedRedirectFrom}`,
},
});
from hydrogen.
Related Issues (20)
- Can't remove cart attribute using cartAttributesUpdate action from useCart() hook HOT 1
- Hydration errors when using Script component with getSeoMeta HOT 2
- Modelviewer throws SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data HOT 2
- Make sure Hydrogen 400 errors on bad requests
- Canonical link from `getSeoMeta` is not updated on path change HOT 1
- Customer Account API - prompt none parameter breaks auth flow HOT 2
- Preferences missing from CartBuyerIdentityInput type HOT 3
- Unmounting CartForm cancels fetch HOT 3
- Tailwind Alpha not working on new projects HOT 1
- cli-hydrogen overwrites vite customLogger
- Pagination not consistent on refresh of page HOT 1
- Source map for Customer Privacy API is outdated
- Issue with Tracking Pixel Events Using Shopify Documentation HOT 4
- Improve the image component HOT 1
- Money component memoization broken
- Unable to create linked Hydrogen repo HOT 4
- href attribute mismatch using the Pagination Component HOT 7
- VariantSelector component: nonexistent variants for product options are showing up as isAvailable: true HOT 2
- useOptimisticCart doesn't add isOptimistic to cart and cart line item HOT 3
- Inlining CSS with the ?inline parameter generates a link tag with the style as the href HOT 3
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 hydrogen.