External JS Library issue

pikaday.zip (25.1 KB)
I’m trying to utilise the pikaday.js library. It works well when run locally direct from Hype, but if I view the file from a web server then for some reason it can’t see the included pikaday.js file.

Any ideas?

I’ll have a look later as I’m not near my computer at the moment but I had some issues in the past where things haven’t run on my server because it’s not secure. Once I’ve uploaded the same file onto a secure server it’s worked fine. Just a thought

Are there any errors in the developer console?

I tested in Hype’s preview, as a file URL, and on my own server, and had no issues. The code itself doesn’t seem to do anything out of the ordinary that would cause problems. The most likely culprits are permission issues on the files or that they were not uploaded correctly.

Feel free to also include a link to the URL where there is a failure, since that is what we’d need to see to determine the problem.

OK the problem is solved thanks to both of your responses.

I looked on my server and both the pikaday.js /css files are zero bytes (all other files ok). As soon as I upload them it works both locally and from my server. This must be permissions.

I now wonder though why when I export from hype to my server via SSH that I’m getting this and not locally, and only with these two files. I’ll look into that one later.

Thanks

@jonathan
I’ve just confirmed that none of my included js files (files I’ve dragged into Hype) are exported correctly when exporting to my server via SSHFS. They all have a size of zero bytes.

Here is my SSHFS connection string:
sshfs -o allow_other,auto_cache,reconnect,defer_permissions,noappledouble,IdentityFile=~/.ssh/id_rsa root@x.x.x.x:/root/App /Users/xx/Documents/RemoteServerMounts

When you export from Hype, the file size is correct though?

So it sounds like the problem is in your upload or in the storage on the web server. I am not familiar with sshfs as this is not a standard command line tool. I personally just use Panic’s Transmit to upload simple stuff or rsync for more elaborate cases.

If I export to my Mac, the file sizes are correct. If I export to the mount point, which is a mount point on my server via SSHFS, then I get this issue, but only with external JS files. Other JS documents that have been created within Hype (e.g. run js on button press), these all work.