Open IMS94 opened 10 months ago
Adding a postinstall
script like below to the app's package.json solves the issue.
{
"scripts": {
"postinstall": "cd <app_dir> && yarn install"
}
}
We should probably add the above postinstall script when the custom page is being created.
Weird 🤔 , this should not be the case. The install should already install react deps.
for what it's worth, I just ran into the same issue with a vue app. Thanks @IMS94 for posting your solution.
Might it be that the package.json is simply installed one directory too deep? On the react option, the package.json lies at cd
?
In any case for me the solution posted by @IMS94 unfortunately doesn't work. Haven't found a solution yet. @IMS94 was there anything else you had to do? Is the package.json also at the extra depth? Cheers
Might it be that the package.json is simply installed one directory too deep? On the react option, the package.json lies at
/ /package.json, which is unlike the default place at /package.json, hence requiring an extra cd
? In any case for me the solution posted by @IMS94 unfortunately doesn't work. Haven't found a solution yet. @IMS94 was there anything else you had to do? Is the package.json also at the extra depth? Cheers
ok nevermind I figured it out. As I had my package.json in
I used
bench --site <site-name> add-custom-page --app <app-name>
to create a custom page with React. When I commit my changes and try to get that app to another bench viabench get-app
, it fails at thebench build --app <app>
command.Here's the complete output when I tried to install this app on a bench in frappe cloud. Note the lines like
[ERROR] Could not resolve "react"
.