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

Unable to load rivescript-js resource from online source #294

Open
CodeRoller opened this issue Nov 7, 2018 · 7 comments
Open

Unable to load rivescript-js resource from online source #294

CodeRoller opened this issue Nov 7, 2018 · 7 comments

Comments

@CodeRoller
Copy link

CodeRoller commented Nov 7, 2018

I'm trying out rivescript-js on my localhost. I have an html page that calls the online rivescript with

<script src=”https://unpkg.com/rivescript@latest/dist/rivescript.min.js"></script>

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.

@kjleitz
Copy link
Contributor

kjleitz commented Nov 7, 2018

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?

@dcsan
Copy link
Contributor

dcsan commented Nov 7, 2018

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/

@kirsle
Copy link
Member

kirsle commented Nov 7, 2018

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.com domain 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)

@CodeRoller
Copy link
Author

CodeRoller commented Nov 8, 2018 via email

@CodeRoller
Copy link
Author

CodeRoller commented Nov 8, 2018 via email

@dcsan
Copy link
Contributor

dcsan commented Nov 8, 2018

there are lots of free plain text/code editors like VSCode or Notepad++ (on windows). best not to use a word processor for code 👩‍💻

@CodeRoller
Copy link
Author

CodeRoller commented Nov 8, 2018 via email

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

No branches or pull requests

4 participants