rivescript-js
rivescript-js copied to clipboard
Unable to load rivescript-js resource from online source
I'm trying out rivescript-js on my localhost. I have an html page that calls the online rivescript with
But I am getting a 404 error that the resource failed to load.
I have also tried to call my local rivescript.js but that didn't work either. Nothing has successfully loaded and I am not sure what is wrong. Any help would be appreciated.
I am running Tomcat 9.0 server on Windows 10. My Tomcat is running and does jsp files fine.
Can you copy and paste the part of your HTML where your script tag is placed? I can load the CDN link just fine as text in the browser, so maybe there's a typo somewhere.
Are you getting a 404 for the script or are you getting a 404 for the page itself? i.e., are you able to load the page, but seeing a 404 for rivescript.min.js in the network tab of dev tools? Or are you unable to load the page in its entirety?
right this URL works fine https://unpkg.com/rivescript@latest/dist/rivescript.min.js
at least paste the client side error logs here... If you're serving up a JSP page, with the URL embedded, perhaps the URL is escaped/encoded somehow. what you see in the source might not what you think it is. https://www.urlencoder.org/
Can confirm the unpkg.com CDN link works. The exact URL is used on the RiveScript Playground and the Try Online pages and those work for me now.
Some other blind ideas to try:
- Is the
unpkg.comdomain completely blocked from your network? Might explain the 404 or if there's a filter in place preventing this domain from your server environment. - If the two links above work (using the same CDN URL you are) but yours doesn't, find what's different between the environments.
- Is the script being included "server side" by any means? (not sure how a
<script>tag would be a server side concern but I've seen weird things) and if so there may be different network environments. - Is it running from an environment with permission enforcement? i.e. in a Cordova application for Android; if you didn't grant it Internet access it might be blocked from loading an external script (if you're doing something like this: embed rivescript.js directly with your app, so it wouldn't break when the user loses internet access anyway)
hi -
Thank you for your suggestions - I solved the problem at dawn, it turned out when I was fooling around with the code, before putting it on my local host, I created typos and used a Word Processor all of which contributed to extraneous characters in the output. When I chose "inspect" in the browser I saw the situation and corrected it. Now it's working perfectly, and I am super excited about the possibilities of rivescript! Again thanks for our help. Amy
hi -
You were onto something. Thank you for your suggestions - I solved the problem at dawn, it turned out when I was fooling around with the code, before putting it on my localhost, I created typos and used a Word Processor all of which contributed to extraneous characters in the output, i.e. escape codes
When I chose "inspect" in the browser I saw the situation and corrected it. Now it's working perfectly, and I am super excited about the possibilities of rivescript! Again thanks for our help. Amy
there are lots of free plain text/code editors like VSCode or Notepad++ (on windows). best not to use a word processor for code 👩💻
Yes, I will probably start using one since the error I made is a common one which I would have probably caught much quicker in the past when I was a full-time programmer. Thanks again! Now I can enjoy the benefits of Rivescript which really fascinates me.