Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails #375

Closed
SvbZ3r0 opened this issue Nov 15, 2024 · 3 comments
Closed

Install fails #375

SvbZ3r0 opened this issue Nov 15, 2024 · 3 comments

Comments

@SvbZ3r0
Copy link

SvbZ3r0 commented Nov 15, 2024

I have 2 systems with ERPNext installed. I have no issues installing print_designer on one of those systems. On the other, installing fails fatally.
Might be related to an environment issue that also causes frappe/frappe#28470

Stacktrace:

yarn run v1.22.22
warning ../../package.json: No license field
$ node esbuild --production --run-build-command
 [ERROR] Could not resolve "canvas"

    ../print_designer/print_designer/public/js/pdf.worker.min.js:22:25511:
      22  ...trix&&a.isNodeJS&&(globalThis.DOMMatrix=require("canvas").DOMMatrix)}();!function checkPath2D(){if(glob...
                                                             ~~~~~~~~

  You can mark the path "canvas" as external to exclude it from the bundle, which will remove this
  error. You can also surround this "require" call with a try/catch block to handle this failure at
  run-time instead of bundle-time.

Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
 [ERROR] [plugin frappe-vue-style] Cannot read properties of undefined (reading 'outputs')

    /home/erp/vbt-prod/apps/frappe/esbuild/frappe-vue-style.js:10:41:
      10        let files = get_files(result.metafile.outputs);
                                                      ^

    at /home/erp/vbt-prod/apps/frappe/esbuild/frappe-vue-style.js:10:42
    at /home/erp/vbt-prod/apps/frappe/node_modules/esbuild/lib/main.js:1052:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

  This error came from the "onEnd" callback registered here:

    /home/erp/vbt-prod/apps/frappe/esbuild/frappe-vue-style.js:9:8:
      9      build.onEnd((result) => {
                   ~~~~~

    at setup (/home/erp/vbt-prod/apps/frappe/esbuild/frappe-vue-style.js:9:9)
    at handlePlugins (/home/erp/vbt-prod/apps/frappe/node_modules/esbuild/lib/main.js:855:23)

 ERROR  There were some problems during build

Error: Build failed with 2 errors:
../print_designer/print_designer/public/js/pdf.worker.min.js:22:25511: ERROR: Could not resolve "canvas"
/home/erp/vbt-prod/apps/frappe/esbuild/frappe-vue-style.js:10:41: ERROR: [plugin: frappe-vue-style] Cannot read properties of undefined (reading 'outputs')
    at failureErrorWithLog (/home/erp/vbt-prod/apps/frappe/node_modules/esbuild/lib/main.js:1624:15)
    at /home/erp/vbt-prod/apps/frappe/node_modules/esbuild/lib/main.js:1266:28
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Terminated
error Command failed with exit code 143.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/erp/vbt-prod/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/home/erp/vbt-prod/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/erp/vbt-prod/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/erp/vbt-prod/env/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/erp/vbt-prod/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erp/vbt-prod/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erp/vbt-prod/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erp/vbt-prod/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/erp/vbt-prod/apps/frappe/frappe/commands/utils.py", line 77, in build
    bundle(
  File "/home/erp/vbt-prod/apps/frappe/frappe/build.py", line 254, in bundle
    frappe.commands.popen(command, cwd=frappe_app_path, env=get_node_env(), raise_err=True)
  File "/home/erp/vbt-prod/apps/frappe/frappe/commands/__init__.py", line 97, in popen
    raise subprocess.CalledProcessError(return_, command)
subprocess.CalledProcessError: Command 'yarn run production --run-build-command' returned non-zero exit status 143.

Output of bench version

Doesn't work

agriculture 0.0.1
ecommerce_integrations 1.20.1
erpnext 15.42.0
frappe 15.47.2
hrms 15.35.1
india_compliance 15.13.5
payments 0.0.1

Works

crm 1.26.0
erpnext 15.42.0
frappe 15.47.2
hrms 15.35.1
india_compliance 15.13.5
payments 0.0.1
print_designer 1.4.3

Both systems run:
Ubuntu 20.04 LTS
Frappe manual install

@SvbZ3r0
Copy link
Author

SvbZ3r0 commented Nov 15, 2024

Install issue was due to node v22.
Node v18 works.

@SvbZ3r0
Copy link
Author

SvbZ3r0 commented Dec 23, 2024

@NagariaHussain is support for node v22 being planned?

@maharshivpatel
Copy link
Collaborator

i have decided to remove the pdfjs-dist which used canvas package as it was not providing enough benefit to manage external dependency. may add it in the future if required. #388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants