Skip to content
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

Error thrown in loadTheme after renderTheme #189

Closed
brandonjp opened this issue Jan 16, 2020 · 1 comment
Closed

Error thrown in loadTheme after renderTheme #189

brandonjp opened this issue Jan 16, 2020 · 1 comment

Comments

@brandonjp
Copy link

brandonjp commented Jan 16, 2020

I'm troubleshooting a stencil-cli issue where stencil server is throwing an error: Cannot read property 'fn' of null

I finally tracked it down to line 30 of pencil-response.js in stencil-cli. However, the actual error from stencil-cli is pretty unhelpful.

When I log the templatePath and data returned on line 29 the data appears almost identical for products that are rendering and products that are not.

Can anyone help me understand what would be triggering an error such as this: Cannot read property 'fn' of null ? Such as... would it be client-side JS? or by something contained in product data returned from BigCommerce? etc.

Trying however I can to track this down. Anything helps! Thanks.

PixelSnap 2020-01-16 at 14 31 01@2x

@brandonjp
Copy link
Author

brandonjp commented Jan 18, 2020

I found it!
Apparently stencil's handlebars doesn't like this uppercase inside of replace:

{{#replace (uppercase brand.name) (uppercase name)}}{{/replace}}

Using lowercase or toLowerCase does not produce the error and works like a charm.

But daaaang, better error logging would be reeeaal helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant