How to use frappe.call on custom html pages

I have created a custom app with page_1.html , page_1.py file have also defined page.js in public/js.
Added the js file to hooks as well
app_include_js = “/templates/pages/page.js”

I am trying to call a custom method on a custom page.
but getting error
Uncaught ReferenceError: frappe is not defined

Refer this.

Edit: On v11, you can use frappe.call on webpages.

1 Like

Hi @Aniket_Shinde1
any updates on this issue?

I figured out the issue it is resolved now

What did you do to resolve this?

@Aniket_Shinde1 you didn’t explain your solution well. please help with detailed solution on this.

The solution that actually works is in this Tutorial 34 and Tutorial 35 by @mymi14s. Tutorial 34 solves the problem and Tutorial 35 fixes some error in 34.

on V14 the issue still

did you find any solution for this issue, i am facing same .

you must change the path for JS (Permission Issue)

Could you please share the directory path?

Tested In Version 14.0

Add Below In Your Page’s head section

	<script type="text/javascript" src="/assets/frappe/dist/js/frappe-web.bundle.HL3LQV7I.js"></script>

    <script type="text/javascript" src="/website_script.js"></script>
    <script type="text/javascript" src="/assets/erpnext/dist/js/erpnext-web.bundle.22EWE5JY.js"></script>

Then add below as the last line before closing tag of your page

< script >frappe.csrf_token = “{{frappe.session.csrf_token}}”;</ script >

To test it, open Developer Tool Then Go To Console… The Paste below
frappe.msgprint(__(‘Hello From Frappe UI’));