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

Error while making rpc call #94

Closed
hkasera opened this issue Oct 18, 2017 · 6 comments
Closed

Error while making rpc call #94

hkasera opened this issue Oct 18, 2017 · 6 comments

Comments

@hkasera
Copy link

hkasera commented Oct 18, 2017

Hello,

I am receiving this below error while making a rpc call -
Server-side code uses client-side-only identifier "Basis.mouseEvent"

Basically I am reading values from database and listing into a table. In each table row, there is a button which will make a rpc call with parameter as one of column value returned from the database.

rows <- queryX (SELECT * FROM peers WHERE)
		            (fn row => <xml><tr>
		            	<td>{[row.Peers.C]}</td>
		             	<td>
		            		<button value="Update" onclick={fn _ => n <- rpc (increment row.Peers.C); set src n}/>
		             	</td>
		            </tr></xml>);

row.Peers.C is a string column.

I am unable to comprehend the error. Any insights into this would be helpful.

@achlipala
Copy link
Contributor

Can you share a self-contained example, ideally in a single .ur file, so I can try compiling?

@hkasera
Copy link
Author

hkasera commented Oct 19, 2017

@hkasera
Copy link
Author

hkasera commented Oct 23, 2017

Can I please get an update on this?

@achlipala-biz
Copy link

Sorry, I'm busy and can't promise when I'll look into it.

@hkasera
Copy link
Author

hkasera commented Oct 29, 2017

Hello,

We got a reply on the mailing list that -

Changing the onclick handler to avoid capturing
row.Peers.A - i.e., I changed your SELECT statement to

SELECT Peers.C FROM peers WHERE peers.A > {[me]} OR peers.A < {[me]}

and it compiled.

This is definitely a case of a bad error message, but there may be more
in play here. It sounds like the compiler is trying to evaluate the body
of the onclick handler on the server instead of on the client, which
seems wrong to me. This may also be related to Ur/Web's apparent
inability to handle client IDs on the client side [1]. In any case,
though, if anybody else has experienced issues like this, please speak
up.

It would be great when you have time, to help us understand this.

Regards,
Harshita Kasera

@achlipala
Copy link
Contributor

I think Benjamin's diagnosis on the mailing list is pretty good. I'll follow up there now.

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

3 participants