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

​electron desktop can't run but with errors! #8711

Open
1 task
Rayi opened this issue Nov 5, 2024 · 2 comments
Open
1 task

​electron desktop can't run but with errors! #8711

Rayi opened this issue Nov 5, 2024 · 2 comments

Comments

@Rayi
Copy link

Rayi commented Nov 5, 2024

What happened?

when i follow https://docs.affine.pro/docs/development/dev-guide/electron-dev-guide steps , with 'yarn run dev:electron' command, it throws errors.

Before this, 'yarn install' command runs successfully.

image

image

node -v
v20.17.0

yarn -v
4.1.1

Distribution version

macOS x64 (Intel)

What browsers are you seeing the problem on if you're using web version?

Other

Are you self-hosting?

  • Yes

Relevant log output

$ yarn run dev:electron
(node:41136) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("ts-node/esm/transpile-only", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:41136) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
✘ [ERROR] Could not resolve "@sentry/electron/preload"

    src/preload/index.ts:1:7:
      1 │ import '@sentry/electron/preload';
~~~~~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@sentry/electron" here because it's not listed as
  a dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@sentry/electron/preload" as external to exclude it from the bundle, which
  will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@sentry/electron/main"

    src/main/index.ts:5:30:
      5 │ import { init, IPCMode } from '@sentry/electron/main';
        ╵                               ~~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@sentry/electron" here because it's not listed as
  a dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "@sentry/electron/main" as external to exclude it from the bundle, which
  will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "async-call-rpc"

    src/helper/index.ts:1:26:
      1 │ import { AsyncCall } from 'async-call-rpc';
~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "async-call-rpc" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "async-call-rpc" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "electron-squirrel-startup"

    src/main/index.ts:33:12:
      33 │ if (require('electron-squirrel-startup')) app.quit();
         ╵             ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "electron-squirrel-startup" here because it's not
  listed as a dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

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

✘ [ERROR] Could not resolve "electron-log"

    src/helper/logger.ts:1:16:
      1 │ import log from 'electron-log';
~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "electron-log" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "electron-log" as external to exclude it from the bundle, which will remove
  this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "zod"

    src/main/config.ts:1:18:
      1 │ import { z } from 'zod';
        ╵                   ~~~~~

  The Yarn Plug'n'Play manifest forbids importing "zod" here because it's not listed as a dependency
  of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "zod" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "electron-log"

    src/main/logger.ts:2:16:
      2 │ import log from 'electron-log';
~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "electron-log" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "electron-log" as external to exclude it from the bundle, which will remove
  this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "electron-window-state"

    src/main/main-window.ts:6:32:
      6 │ import electronWindowState from 'electron-window-state';
        ╵                                 ~~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "electron-window-state" here because it's not
  listed as a dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "electron-window-state" as external to exclude it from the bundle, which
  will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "async-call-rpc"

    src/preload/electron-api.ts:3:26:
      3 │ import { AsyncCall } from 'async-call-rpc';
~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "async-call-rpc" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "async-call-rpc" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "rxjs"

    src/preload/electron-api.ts:5:24:
      5 │ import { Subject } from 'rxjs';
        ╵                         ~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "rxjs" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "rxjs" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "rxjs"

    src/main/updater/event.ts:1:41:
      1 │ import { BehaviorSubject, Subject } from 'rxjs';
~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "rxjs" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "rxjs" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "zod"

    ../../common/infra/src/app-config-storage.ts:1:18:
      1 │ import { z } from 'zod';
        ╵                   ~~~~~

  The Yarn Plug'n'Play manifest forbids importing "zod" here because it's not listed as a dependency
  of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "zod" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "rxjs"

    src/main/application-menu/subject.ts:1:24:
      1 │ import { Subject } from 'rxjs';
~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "rxjs" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "rxjs" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "rxjs"

    src/main/ui/subject.ts:1:24:
      1 │ import { Subject } from 'rxjs';
        ╵                         ~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "rxjs" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "rxjs" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "async-call-rpc"

    src/main/helper-process.ts:4:26:
      4 │ import { AsyncCall } from 'async-call-rpc';
~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "async-call-rpc" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "async-call-rpc" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "zod"

    src/preload/electron-api.ts:6:18:
      6 │ import { z } from 'zod';
        ╵                   ~~~~~

  The Yarn Plug'n'Play manifest forbids importing "zod" here because it's not listed as a dependency
  of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "zod" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "link-preview-js"

    src/main/ui/handlers.ts:2:31:
      2 │ import { getLinkPreview } from 'link-preview-js';
~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "link-preview-js" here because it's not listed as
  a dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "link-preview-js" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "builder-util-runtime"

    src/main/updater/custom-github-provider.ts:12:46:
      12 │ import { HttpError, newError, parseXml } from 'builder-util-runtime';
         ╵                                               ~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "builder-util-runtime" here because it's not
  listed as a dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "builder-util-runtime" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "fs-extra"

    src/main/export/pdf.ts:2:15:
      2 │ import fs from 'fs-extra';
~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "fs-extra" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "fs-extra" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@blocksuite/global/utils"

    src/helper/main-rpc.ts:1:29:
      1 │ import { assertExists } from '@blocksuite/global/utils';
        ╵                              ~~~~~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@blocksuite/global" here because it's not listed
  as a dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "@blocksuite/global/utils" as external to exclude it from the bundle, which
  will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "async-call-rpc"

    src/helper/main-rpc.ts:2:26:
      2 │ import { AsyncCall } from 'async-call-rpc';
~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "async-call-rpc" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "async-call-rpc" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "rxjs"

    src/helper/workspace/subjects.ts:1:24:
      1 │ import { Subject } from 'rxjs';
        ╵                         ~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "rxjs" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "rxjs" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@affine/native"

    src/main/ui/challenge.ts:1:38:
      1 │ import { mintChallengeResponse } from '@affine/native';
~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@affine/native" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@affine/native" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "fs-extra"

    src/helper/workspace/handlers.ts:3:15:
      3 │ import fs from 'fs-extra';
        ╵                ~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "fs-extra" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "fs-extra" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "rxjs"

    src/helper/db/workspace-db-adapter.ts:2:24:
      2 │ import { Subject } from 'rxjs';
~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "rxjs" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "rxjs" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@affine/native"

    src/helper/dialog/dialog.ts:1:33:
      1 │ import { ValidationResult } from '@affine/native';
        ╵                                  ~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@affine/native" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "@affine/native" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "fs-extra"

    src/helper/workspace/meta.ts:3:15:
      3 │ import fs from 'fs-extra';
~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "fs-extra" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "fs-extra" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "fs-extra"

    src/helper/dialog/dialog.ts:3:15:
      3 │ import fs from 'fs-extra';
        ╵                ~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "fs-extra" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "fs-extra" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "nanoid"

    src/helper/dialog/dialog.ts:4:23:
      4 │ import { nanoid } from 'nanoid';
~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "nanoid" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "nanoid" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@affine/native"

    src/helper/db/base-db-adapter.ts:2:51:
      2 │ import { SqliteConnection, ValidationResult } from '@affine/native';
        ╵                                                    ~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@affine/native" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "@affine/native" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@affine/native"

    src/helper/db/migration.ts:3:33:
      3 │ import { SqliteConnection } from '@affine/native';
~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@affine/native" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@affine/native" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@blocksuite/blocks/schemas"

    src/helper/db/migration.ts:4:30:
      4 │ import { AffineSchemas } from '@blocksuite/blocks/schemas';
        ╵                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@blocksuite/blocks" here because it's not listed
  as a dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "@blocksuite/blocks/schemas" as external to exclude it from the bundle,
  which will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@blocksuite/store"

    src/helper/db/migration.ts:5:23:
      5 │ import { Schema } from '@blocksuite/store';
~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@blocksuite/store" here because it's not listed
  as a dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@blocksuite/store" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "fs-extra"

    src/helper/db/migration.ts:12:15:
      12 │ import fs from 'fs-extra';
         ╵                ~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "fs-extra" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "fs-extra" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "nanoid"

    src/helper/db/migration.ts:13:23:
      13 │ import { nanoid } from 'nanoid';
~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "nanoid" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "nanoid" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "nanoid"

    ../../common/infra/src/blocksuite/migration/subdoc.ts:1:23:
      1 │ import { nanoid } from 'nanoid';
        ╵                        ~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "nanoid" here because it's not listed as a
  dependency of this package:

    ../../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
~~

  You can mark the path "nanoid" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

Starting electron...
Electron is started, watching for changes...
2024-11-05 20:27:44.619 Electron[41225:85565803] +[IMKClient subclass]: chose IMKClient_Legacy
2024-11-05 20:27:44.619 Electron[41225:85565803] +[IMKInputSession subclass]: chose IMKInputSession_Legacy

Anything else?

No response

@pengx17
Copy link
Collaborator

pengx17 commented Nov 6, 2024

  The Yarn Plug'n'Play manifest forbids importing "@sentry/electron" here because it's not listed as
  a dependency of this package:

I am not sure but it seems you enbled pnp. Can you make sure the git repo is clean, and pnp is not enabled for affine repo (also check its ancestor folders) and globally?

@Rayi
Copy link
Author

Rayi commented Nov 6, 2024

After i removed the file '.pnp.cjs', it works. It is hard to find out why pnp enabled. I cloned the git repo without doing anything.

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

2 participants