Search code examples
pythonframeworksmasonite

Masonite - TypeError > encoding without a string argument


Whenever I render a view, the error

encoding without a string argument`

is being thrown. This is my controller method:

def show(self, Application):
    view('welcome', {'app': Application})

Solution

  • This error is being thrown because your view is not returning anything. Your view should always have a return in it because Masonite needs to know what you want to display.

    You can fix this error by returning the view:

    def show(self, Application):
        return view('welcome', {'app': Application})