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

PreviewProps is not a function #132

Closed
tom3rr opened this issue Jan 10, 2024 · 5 comments · Fixed by #136
Closed

PreviewProps is not a function #132

tom3rr opened this issue Jan 10, 2024 · 5 comments · Fixed by #136

Comments

@tom3rr
Copy link

tom3rr commented Jan 10, 2024

  • Component or Package Name: Preview
  • Component or Package Version: 1.7.2
  • @jsxp-email/cli Version?:
  • Operating System (or Browser): Chrome
  • Node Version: 20.10.0
  • Link to reproduction (⚠️ read below): N/A

Expected Behavior

Using a sample, it should open in the email preview with the defined props in PreviewProps.

Actual Behavior

Preview page is blank, console.log throwing "PreviewProps is not a function" error.

Additional Information

Using any example from the email samples out-of-the-box is not working as most of them have PreviewProps defined. If this is a docs issue, please let me know how to provide template props for previews.

@shellscape
Copy link
Owner

Not sure what you're describing. That url works fine?

@tom3rr
Copy link
Author

tom3rr commented Jan 10, 2024

I am sorry for not being clear enough. The url is for referencing the samples that are not working locally.

If I copy the code from that sample page, for example the Airbnb-review, and use it as it is in my local dev environment, it is not working.

AirbnbReviewEmail.PreviewProps = { authorName: 'Joker', authorImage: ${baseUrl}batman-twilight.jpg, reviewText: "Batsy's stay at my Airbnb Batcave was a riot! Batman surprised with a hidden sense of humor, engaging in epic banter and a prank war. His detective skills impressed, and the Batcave remained spotless. Game night and snacks were a hit, and even during downtime, he couldn't resist a Bat-signal. Hosting Batsy was chaos perfected – if you want a guest with brooding intensity and unexpected laughter, Batman's your Bat. Hahahahahahahahahaha! " } as AirbnbReviewEmailProps;

It seems that the above snippet, the PreviewProps definition is not working locally as it is not recognized. Am I doing something wrong?

@shellscape
Copy link
Owner

Am I doing something wrong?

Probably not :)

Could you put together a reproduction using https://stackblitz.com/edit/jsx-email-repro when you have the chance? I'm not able to reproduce locally, but that doesn't mean your issue doesn't exist. A reproduction will help me see the same code in the same environment as you so that I can debug.

@tom3rr
Copy link
Author

tom3rr commented Jan 10, 2024

Sure thing, here it is: https://stackblitz.com/edit/jsx-email-repro-vzgqmc

@shellscape
Copy link
Owner

Perfect thanks

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

Successfully merging a pull request may close this issue.

2 participants