Error while starting bench | ✘ [ERROR] Could not resolve "vue/dist/vue.js

34:19 watch.1       | ✘ [ERROR] Could not resolve "vue/dist/vue.js"
16:34:19 watch.1       | 
16:34:19 watch.1       |     frappe/public/js/frappe/recorder/recorder.js:1:16:
16:34:19 watch.1       |       1 │ import Vue from "vue/dist/vue.js";
16:34:19 watch.1       |         ╵                 ~~~~~~~~~~~~~~~~~
16:34:19 watch.1       | 
16:34:19 watch.1       |   The module "./dist/vue.js" was not found on the file system:
16:34:19 watch.1       | 
16:34:19 watch.1       |     frappe/public/node_modules/vue/package.json:65:16:
16:34:19 watch.1       |       65 │     "./dist/*": "./dist/*",
16:34:19 watch.1       |          ╵                 ~~~~~~~~~~
16:34:19 watch.1       | 
16:34:19 watch.1       |   You can mark the path "vue/dist/vue.js" as external to exclude it from the bundle, which will remove this error.
16:34:19 watch.1       | 
16:34:19 watch.1       | ✘ [ERROR] Could not resolve "vue-router/dist/vue-router.js"
16:34:19 watch.1       | 
16:34:19 watch.1       |     frappe/public/js/frappe/recorder/recorder.js:2:22:
16:34:19 watch.1       |       2 │ import VueRouter from "vue-router/dist/vue-router.js";
16:34:19 watch.1       |         ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:34:19 watch.1       | 
16:34:19 watch.1       |   The module "./dist/vue-router.js" was not found on the file system:
16:34:19 watch.1       | 
16:34:19 watch.1       |     frappe/public/node_modules/vue-router/package.json:27:16:
16:34:19 watch.1       |       27 │     "./dist/*": "./dist/*",
16:34:19 watch.1       |          ╵                 ~~~~~~~~~~
16:34:19 watch.1       | 
16:34:19 watch.1       |   You can mark the path "vue-router/dist/vue-router.js" as external to exclude it from the bundle, which will remove this error.
16:34:19 watch.1       | 
16:34:19 watch.1       | ✘ [ERROR] Could not resolve "vue/dist/vue.esm.js"
16:34:19 watch.1       | 
16:34:19 watch.1       |     frappe/public/js/libs.bundle.js:2:16:
16:34:19 watch.1       |       2 │ import Vue from "vue/dist/vue.esm.js";
16:34:19 watch.1       |         ╵                 ~~~~~~~~~~~~~~~~~~~~~
16:34:19 watch.1       | 
16:34:19 watch.1       |   The module "./dist/vue.esm.js" was not found on the file system:
16:34:19 watch.1       | 
16:34:19 watch.1       |     frappe/public/node_modules/vue/package.json:65:16:
16:34:19 watch.1       |       65 │     "./dist/*": "./dist/*",
16:34:19 watch.1       |          ╵                 ~~~~~~~~~~
16:34:19 watch.1       | 
16:34:19 watch.1       |   You can mark the path "vue/dist/vue.esm.js" as external to exclude it from the bundle, which will remove this error.
16:34:19 watch.1       |

i am successfully starting a bench but while staring a bench this error occurs

any problem here

UI is gone how to solve it ?

Hi @nilpatel42:

Try bench build
Hope this helps.

bench build giving this error @avc

yarn run v1.22.19
warning ../../package.json: No license field
$ node esbuild --production --run-build-command
✘ [ERROR] Could not resolve "vue/dist/vue.esm.js"

    frappe/public/js/libs.bundle.js:2:16:
      2 │ import Vue from "vue/dist/vue.esm.js";
        ╵                 ~~~~~~~~~~~~~~~~~~~~~

  The module "./dist/vue.esm.js" was not found on the file system:

    frappe/public/node_modules/vue/package.json:65:16:
      65 │     "./dist/*": "./dist/*",
         ╵                 ~~~~~~~~~~

  You can mark the path "vue/dist/vue.esm.js" as external to exclude it from the bundle, which will
  remove this error.

✘ [ERROR] Could not resolve "vue/dist/vue.js"

    frappe/public/js/frappe/recorder/recorder.js:1:16:
      1 │ import Vue from "vue/dist/vue.js";
        ╵                 ~~~~~~~~~~~~~~~~~

  The module "./dist/vue.js" was not found on the file system:

    frappe/public/node_modules/vue/package.json:65:16:
      65 │     "./dist/*": "./dist/*",
         ╵                 ~~~~~~~~~~

  You can mark the path "vue/dist/vue.js" as external to exclude it from the bundle, which will
  remove this error.

✘ [ERROR] Could not resolve "vue-router/dist/vue-router.js"

    frappe/public/js/frappe/recorder/recorder.js:2:22:
      2 │ import VueRouter from "vue-router/dist/vue-router.js";
        ╵                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The module "./dist/vue-router.js" was not found on the file system:

    frappe/public/node_modules/vue-router/package.json:27:16:
      27 │     "./dist/*": "./dist/*",
         ╵                 ~~~~~~~~~~

  You can mark the path "vue-router/dist/vue-router.js" as external to exclude it from the bundle,
  which will remove this error.
here were some problems during build

Error: Build failed with 3 errors:
frappe/public/js/frappe/recorder/recorder.js:1:16: ERROR: Could not resolve "vue/dist/vue.js"
frappe/public/js/frappe/recorder/recorder.js:2:22: ERROR: Could not resolve "vue-router/dist/vue-router.js"
frappe/public/js/libs.bundle.js:2:16: ERROR: Could not resolve "vue/dist/vue.esm.js"
    at failureErrorWithLog (/home/can/frappe-bench/apps/frappe/node_modules/esbuild/lib/main.js:1624:15)
    at /home/can/frappe-bench/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/can/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
  File "/home/can/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/can/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/can/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/can/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/can/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/can/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/can/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/can/frappe-bench/apps/frappe/frappe/commands/utils.py", line 86, in build
    bundle(mode, apps=apps, hard_link=hard_link, verbose=verbose, skip_frappe=skip_frappe)
  File "/home/can/frappe-bench/apps/frappe/frappe/build.py", line 256, in bundle
    frappe.commands.popen(command, cwd=frappe_app_path, env=get_node_env(), raise_err=True)
  File "/home/can/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 98, in popen
    raise subprocess.CalledProcessError(return_, command)
subprocess.CalledProcessError: Command 'yarn run production --run-build-command' returned non-zero exit status 143.

thank you

@nilpatel42 please go through this thread.

Then try Bench Build

Thanks

1 Like

Thanks @Suresh_Thakor

i following that command
still error is same

Check your node version with node -v

1 Like

v18.16.1

Try bench setup requirements

1 Like

Thank you very much @avc

This will work without any error