Problem with running digest-learning-app
I pulled the digest-learning-app and went through the instructions. I am using my local API Key and Application ID values based on the local Docker instance of Novu I spun up last week. I believe I have them set properly.
I am able to run the back end and it is listening on port 3000.
I start up the front end and it lists a bunch of warnings but eventually opens my browser with the app running. When I go to add a message and click enter I get this error:
Uncaught runtime errors:
ERROR
Request failed with status code 409
AxiosError: Request failed with status code 409
at settle (http://localhost:3001/static/js/bundle.js:134417:12)
at XMLHttpRequest.onloadend (http://localhost:3001/static/js/bundle.js:133108:66)
I am not familiar with Node nor JavaScript. I have looked through the code, but it is not clear to me where this error is coming from.
Will you please help me figure out what is going wrong with this setup?
Thanks!26 Replies
Hey there!
Instead of docker, can you run a simple mock backend and try to see if it works?
I am running the mock back end that came with the repo. I am just using the key values from the Docker instance.
Can you send me a SS of the request and response body from browser?
Sure thing. One moment.
Also make sure you've done everything correctly as described here: https://docs.novu.co/guides/add-digest-to-inapp-notifications
Novu
How to Add Digest to In-App Notifications - Novu
Leverage the digest functionality to send in-app notifications
Okay. Let me double check that first.
I see. I did not do that part. I just cloned the code and ran it. Besides the keys, I was wondering how the frontend/backend knew what workflow to call in my setup. Let me go through that document first and see what happens then. Thank you!
The digest test page is now working for the most part.
@Todd H., you just advanced to level 2!
What is not working is that the messages are not showing up in the notification box. I am assuming it has something to do with me not setting up the in-app notification properly. What is the variable to get the messages for the handlebar entry?
Currently I have this
{{#each step.events}}
{{subscriber.firstName}}
<br />
<br />
{{/each}}
Which is not even showing the firstName.@sumitsaurabh927 please can you update the sample app readme to contain the guide link. So that people can know to also check the guide out
Updated last night itself
Show me the request and response objects when you click the submit button
Also try logging this to see if it gets logged correctly
I also notice that when I click the the bell icon and then notification box that the key labeled "content" only has line breaks in it.
Do you mean to add a print message in the code?
yes
I am not savvy with Node/JS. Which file should I put the log message? Thanks
no problem here. The request is getting sent and acknowledged. Can you confirm everything works as expected from the Novu dashboard at web.novu.co?
Also, remove this template text with just some messge ('HI") to see if it is getting digested. The message should appear after the specified time starting at when you click submit.
This way, we'll know if there's a problem with your set-up or the template text
Looks like it made it to the server.
I have a meeting now and will return to this in an hour. Thanks for your help.
I put "Hi" in the message template. It is a appearing in the notification box. However the message I sent from the web page "This is a test" is not appearing in the message box.
Yeah, that is to be expected. It is happening because of the template text.
If this is working as expected, it means there's nothing wrong
The only reason why you aren't getting the response you expect is because you're using some variable in the template that isn't getting passed from the FE (maybe not using the same identifier)
I'll urge you to go through the guide once again and pay special care to how you're passing data from the FrontEnd to the BackEnd, whether you're using same identifiers or not.
Also go through the repo if you haven't already.
And also play around with notification template to see if it works as you want it to.
Here are some links for you to explore:
- Guide: https://docs.novu.co/guides/add-digest-to-inapp-notifications
- Repo: https://github.com/novuhq/digest-learning-app/tree/main
Novu
How to Add Digest to In-App Notifications - Novu
Leverage the digest functionality to send in-app notifications
GitHub
GitHub - novuhq/digest-learning-app
Contribute to novuhq/digest-learning-app development by creating an account on GitHub.
I am using the repo you stated above. I was hoping it would just work.
I will go back through the repo code to ensure that the FE and BE are using the same variables.
Also, where can I find a list of all of the variables available for a template? I see these in the editor. Is "message" something I need to add to the template? Or is that automatically part of the message on the UI side?
The variable name depends on how you've written your app. For example, I'm using
name
in that repo.
If you're asking about handlebar variables, you can find a list here: https://docs.novu.co/content-creation-design/handlebars-helpersAh. I see what I did wrong. I was using
tenant.name
instead of name
. Not sure why I put that in there. Now I am seeing the messages. Thanks for your help.