I am currently experiencing this issue on the news aggregator tutorial. When I try to call the add_article server function from the client side.
Welcome to the forum!
Iām not able to replicate this error with a fresh clone of the final News Aggregator tutorial app:Anvil | Login
So in order to receive help, you may need to provide more details about what specifically you have done.
This is the server module:
import anvil.tables as tables
import anvil.tables.query as q
from anvil.tables import app_tables
import anvil.server
from datetime import datetime
This is a server module. It runs on the Anvil server,
rather than in the userās browser.
Those lines run without error for me just now in a server module. Which line of code is triggering the error you are seeing? import anvil.tables as tables
?
Please provide a clone link for your app.
Line 29 of the Homepage client code, the:
anvil.server.call(āadd_articleā, new_article)
This is the link:
https://anvil.works/build#clone:ROYTVHVFNOXBWUPS=CQQL7PG656EO4JIADJ3X62B2
Kind Regards,
You are missing an import in that client module :
import anvil.server
Gets created automatically, I think you must have accidentally deleted it?
Thank you so much, that worked. I donāt see how I could have deleted it but you never know, that must be it.
Kind Regards,
Itās helpful if you click āSolutionā under david.wylieās post.
By the way, that import would not be created automatically if you have unchecked Auto import services in your settings.
I didnāt know that was an option. I knew someone had asked for it, but I must have missed the announcement. Sneaky Updates by any chance?
Deffo missed that one, cheers!
I was about to complain it was in an unintuative place, but anywhere else would make it per app I suppose, and thatās likely a system wide setting.