Using ERPnext with forked version of Frappe

Hi,

I am planning an integration for alternative file hosting solutions when using the Upload files menu in ERPnext (using sharepoint/google drive) and want to customize the file manager in the Frappe framework to add what I need, however I can’t seem to get a working dev environment using a fork of the Frappe framework.

I have downloaded the vagrant box, forked the Frappe repo, and configured my vagrant to share the repo with the /home/frappe/frappe-bench/apps/frappe/ directory on the vagrant. I have run bench migrate and launched ERPnext with bench start, but the app will freeze during setup at step 4 (choosing my domain).

When I disable shared folders with the vagrant, there is no issue, so the issue is when using a forked version of Frappe in lieu of the default files present in /home/frappe/frappe-bench/apps/frappe/.

Does anyone have any idea of what I am doing wrong? Also is there a guide to making integrations for Frappe?

@xvaier welcome to the forum!

Check your JS Console for a clue

libs.min.js:15294 Uncaught SyntaxError: Invalid regular expression: /(^|>|\s|\.|-|/|\\|,|\$|\!|\?|:|;)(dd)($|<|\s|\.|-|/|\\|,|\$|\!|\?|:|;)/: Stack overflow
    at RegExp.[Symbol.replace] (native)
    at String.replace (native)
    at _replacer (http://localhost:8000/assets/js/libs.min.js:15294:8306)
    at m.formatDate (http://localhost:8000/assets/js/libs.min.js:15294:7528)
    at http://localhost:8000/assets/js/libs.min.js:15294:11826
    at Array.map (native)
    at m._setInputValue (http://localhost:8000/assets/js/libs.min.js:15294:11801)
    at m.selectDate (http://localhost:8000/assets/js/libs.min.js:15294:9570)
    at Class.set_input (http://localhost:8000/assets/js/desk.min.js:4459:20)
    at Class.prototype.(anonymous function) [as set_input] (http://localhost:8000/assets/js/desk.min.js:91:20)

This is the error I get in the JS console, however, I wish to state that I have not made any changes to the code. I have only replaced the contents of home/frappe/frappe-bench/apps/frappe/ with the content of the github repository. I have run bench migrate and bench start.

Thanks.

Is your forked version of Frappe up to date with the develop branch?

It is up to date with the branch from this morning.

What do you mean by this? Have you changed/removed any files from frappe?

In the vagrant environment, I have replaced the contents of /home/frappe/frappe-bench/apps/frappe/ with the forked repository. I am wondering if there is an additional manipulation to do in order for this to work.

If I understand your problem correctly:
You would be best to vagrant up, vagrant ssh, cd frappe-bench, bench update the copy of frappe that is already installed in the vagrant box to the latest Dev version. Then work from this if you are having issues.

Hi @System19, That is what I did initially. It does work, but after that how would I fork the frappe repo? I need version tracking to work as I will be putting all of my changes in a pull-request to the frappe framework. I am working on a change for the frappe framework, not an app running frappe.

Here is one way to achieve what you want. Its an excellent tutorial by a @nathan_dole
http://nathandlb.com/erpnext-for-development-part-1-setup-using-vagrant-box/
Another way to achieve the same thing would be to fork frappe to your github account.
Load up erpnext vagrant box.
Uninstall current erpnext and frappe
bench get-app frappe https://github.com/my_github_username/frappe
All git commands can then be run within the VM.
I am hoping to create a tutorial today/this week detailing the process I use from start to finish as there a few tricky “gotchas” that are not detailed very well (or at all) in the Virtual Box, Vagrant and Atom official Doc’s.
If you are setting this up on a Mac I suggest downloading the free and excellent Vagrant Manager

HTH

1 Like

Thank you very much, this looks like it can get me off to a better start! The tutorial would be much appreciated, as you said, there are a couple of sparsely documented parts.

Xavier

Hi Xavier, any luck with your problem?, I have the same one running a fresh frappe/erpnext development version on VirtualBox VM on MacPro, Wizard get stuck on selecting domain then I get your same error in JS console.

Please let me know if you found the solution, thank you

Maurizio