-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility issue with Snipcart #33
Comments
It seems like it's a bug in Pill. When it tries to handle history of the URLs which shouldn't be served. |
I've fixed scroll issue which thrown an undefined property issue when history.state was empty. Now it shows Snipcart's error
But if you open URL |
Thanks for your work so far! |
Try to wrap content with snipcart div, and put snipcart script out of content. probably it should help. <div id="snipcart">
<div id="content">
</div>
</div>
<script src="https://cdn.snipcart.com/themes/v3.0.19/default/snipcart.js"></script> |
I will try doing this and let you know the outcome! |
Looks like this didn't work for me in my local development server. Really appreciate your help! |
I am using Pill and Snipcart together in a project. Snipcart is a "simple shopping cart solution that allows you to turn any website into a fully customizable e-commerce platform". This is done by including Snipcart's assets into the project's HTML code. Like so:
Issue:
Pill works fine when I try to fetch content from other HTML pages, however, when I click on Snipcart's buttons (Account and Cart) and from there click on 'Register', the URL changes from /#/register to /register or from /#/cart/register to /cart/register. The web page will be blank as /register and /cart/register does not exist. The same error occurs when I click on 'Forgot your password?', the URL will change from /#/forgot-password to /forgot-password and the web page will display as blank. The Pill error page from the default Error Handler does not display either.
Furthermore, I have noticed that when I do click on Snipcart's buttons, this error will show up in the JavaScript console:
I understand that I should probably use Pill's shouldServe option to exclude route from Snipcart as Pill must not make any change to the URL or try to load content for any Snipcart URL, however I cannot seem to get this to work.
I have tried the following shouldServe logic without any luck:
You can pass more URLs and use switch statement or you can skip all the links with particular classname:
I've built a dummy website to highlight this issue: Pill Snipcart test site
You can take a look at the source code here: pill-snipcart-test
Thank you so much for reading!
The text was updated successfully, but these errors were encountered: