Fauna DB - unable to get demo working

Run up against a brick wall.....

I've followed (I believe) the example on P333/4 of the dev guide - but no luck. I'm getting a 

"ReferenceError: 'faunadb' is not defined.

All commands copy/pasted into the console with only one difference I've noticed - the documentation talks about (after step 5) "At the end of the result, you should see a line with the Secret: 'secret'.
This didn't appear - the user-role is created and I've checked the priviledges for this role and all seems to be ok.

I created a key from: security->newkey and used that as the secret. I'm guessing this is what I need to do...


Did you execute the script step by step and not all at once?
Due to the asynchronous nature of Fauna operations and the script relying on results of previous steps, it needs to be executed step by step.

Thanks Bruno - I'll check and own up if I was impatient!


Something odd going on - latest version of edge gives the previously mentioned error. Chrome on the otherhand led me to the problem - it returned an error - "undefined index ' users_by_email' leading me to assume permissions were somehow incorrect.

It was a permissions issue that I haven't really tracked down - but I've worked round it be creating a new key from https://dashboard.fauna.com/keys/@db/[mydb] in the admin role.

Interestingly - this now works fine from Chrome and Firefox but Edge is still refusing to play. 

Is this the new Microsoft Edge or the old version?
I cannot see an issue here with the newest Microsoft Edge.

Yep - newest (chromium).
Firefox ok too.

So, this is a browser specific issue in the console of Fauna?
In that case, I would suggest to take this up with Fauna support. It is unclear to me why it would behave different in Microsoft Edge Chromium from Google Chrome or Firefox.

You make a good point.

I hope this thread is useful to anyone looking in - and I would welcome any comments from others to see whether this is just my experience. (Vmware / Win 10 Pro )

Testing Fauna DB demo and it works fine from Delphi IDE / localhost.

When moved files to production server to test works it there, i get this same error :

"ReferenceError: 'faunadb' is not defined

And it comes with Chrome in Windows and Mac, Firefox at Windows and Safari at Mac.

Is this TMS related problem or is it at Fauna?

Edit: Tested now also from my phone with Chrome and Android Interbet, and get same error. So maybe problem is caused by server where app is hosted?

To help us find the issue, could you open the dev console, run the app and send us the full stack trace from the browser dev console?

Here's pic from console, i didn't find there any else info. I have todo app in address https://www.stadinpirssi.fi/todo

EDIT: Just remembered that i have Fauna API key added to code. It's ok, there's nothing to hide. API Key gets added to edit box when user presses login or create account button.

Asked this from Fauna forum and get this answer:

"Hmmm, that seems as if Delphi did not import the faunadb library and/or that something is blocking you from downloading the librar. I’m afraid this is very specific to your environment. Did you manage to import other npm libraries successfully? I have little experience with your enviornment so I’m afraid I can’t help you."

If i understand right, problem seems to be in production server, maybe?

I don't have any clue what npm libraries are what are mentioned in answer.

Find reason why this happens. I opened app in Mac with Chrome, and mac version showed more info in console about error than windows version. It's caused because faunadb-min.js is in http, not https. Production server blocks all downloads what are not secured by https. Run this same thing when XData server was behind http, when moved it to https, it started working.

Solved problem. In Chrome settings is set default that pages what are hosted in https, are not allowed to download content from http addresses. When disabled that from settings, app started working.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.