frappe / books

Free Accounting Software
https://frappe.io/books
GNU Affero General Public License v3.0
2.68k stars 614 forks source link

yarn dev/build results in dependencey errors. Unable to run application. : Could not resolve "source-map-support" #891

Open toduyemi opened 2 months ago

toduyemi commented 2 months ago

Expected Behavior

To be able to run or build application with yarn dev or yarn build

Current Behavior

yarn dev
Debugger listening on ws://127.0.0.1:55551/7cb1176c-4c3f-436a-83c3-738863b02f93
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
running Frappe Books in dev mode
root: /Users/temioduyemi/spire-interview/accounting-tests
✘ [ERROR] Could not resolve "electron-updater"

    main.ts:16:28:
      16 │ import { autoUpdater } from 'electron-updater';
         ╵                             ~~~~~~~~~~~~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

  You can mark the path "electron-updater" as external to exclude it from the bundle, which will
  remove this error.

✘ [ERROR] Could not resolve "source-map-support"

    main.ts:2:8:
      2 │ require('source-map-support').install({
        ╵         ~~~~~~~~~~~~~~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

  You can mark the path "source-map-support" 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.

✘ [ERROR] Could not resolve "electron-devtools-installer"

    main/registerAppLifecycleListeners.ts:2:50:
      2 │ import installExtension, { VUEJS3_DEVTOOLS } from 'electron-devtools-installer';
        ╵                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

  You can mark the path "electron-devtools-installer" as external to exclude it from the bundle,
  which will remove this error.

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

    main/registerIpcMainActionListeners.ts:9:28:
      9 │ import { autoUpdater } from 'electron-updater';
        ╵                             ~~~~~~~~~~~~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

  You can mark the path "electron-updater" as external to exclude it from the bundle, which will
  remove this error.

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

    main/registerAutoUpdaterListeners.ts:2:40:
      2 │ import { autoUpdater, UpdateInfo } from 'electron-updater';
        ╵                                         ~~~~~~~~~~~~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

  You can mark the path "electron-updater" as external to exclude it from the bundle, which will
  remove this error.

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

    main/registerIpcMainActionListeners.ts:11:15:
      11 │ 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:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

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

✘ [ERROR] Could not resolve "node-fetch"

    main/contactMothership.ts:3:18:
      3 │ import fetch from 'node-fetch';
        ╵                   ~~~~~~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

  You can mark the path "node-fetch" as external to exclude it from the bundle, which will remove
  this error.

✘ [ERROR] Could not resolve "node-fetch"

    main/getLanguageMap.ts:19:18:
      19 │ import fetch from 'node-fetch';
         ╵                   ~~~~~~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

  You can mark the path "node-fetch" as external to exclude it from the bundle, which will remove
  this error.

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

    backend/database/manager.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:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

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

✘ [ERROR] Could not resolve "pesa"

    utils/index.ts:2:22:
      2 │ import { Money } from 'pesa';
        ╵                       ~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

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

✘ [ERROR] Could not resolve "luxon"

    backend/database/bespoke.ts:11:25:
      11 │ import { DateTime } from 'luxon';
         ╵                          ~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

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

✘ [ERROR] Could not resolve "luxon"

    utils/misc.ts:1:25:
      1 │ import { DateTime } from 'luxon';
        ╵                          ~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

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

✘ [ERROR] Could not resolve "lodash"

    schemas/index.ts:2:26:
      2 │ import { cloneDeep } from 'lodash';
        ╵                           ~~~~~~~~

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

    ../../.pnp.cjs:2630:31:
      2630 │         "packageDependencies": [\
           ╵                                ~~

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

Waiting for the debugger to disconnect...
/Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:1649
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 13 errors:
backend/database/bespoke.ts:11:25: ERROR: Could not resolve "luxon"
backend/database/manager.ts:2:15: ERROR: Could not resolve "fs-extra"
main.ts:2:8: ERROR: Could not resolve "source-map-support"
main.ts:16:28: ERROR: Could not resolve "electron-updater"
main/contactMothership.ts:3:18: ERROR: Could not resolve "node-fetch"
...
    at failureErrorWithLog (/Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:1649:15)
    at /Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:1058:25
    at runOnEndCallbacks (/Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:1484:45)
    at buildResponseToResult (/Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:1056:7)
    at /Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:1068:9
    at new Promise (<anonymous>)
    at requestCallbacks.on-end (/Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:1067:54)
    at handleRequest (/Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:729:19)
    at handleIncomingPacket (/Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:755:7)
    at Socket.readFromStdout (/Users/temioduyemi/spire-interview/accounting-tests/node_modules/esbuild/lib/main.js:679:7) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: {
        column: 25,
        file: 'backend/database/bespoke.ts',
        length: 7,
        line: 11,
        lineText: "import { DateTime } from 'luxon';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "luxon" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "luxon" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "luxon"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 15,
        file: 'backend/database/manager.ts',
        length: 10,
        line: 2,
        lineText: "import fs from 'fs-extra';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "fs-extra" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "fs-extra" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "fs-extra"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 8,
        file: 'main.ts',
        length: 20,
        line: 2,
        lineText: "require('source-map-support').install({",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "source-map-support" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "source-map-support" 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.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "source-map-support"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 28,
        file: 'main.ts',
        length: 18,
        line: 16,
        lineText: "import { autoUpdater } from 'electron-updater';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "electron-updater" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "electron-updater" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "electron-updater"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 18,
        file: 'main/contactMothership.ts',
        length: 12,
        line: 3,
        lineText: "import fetch from 'node-fetch';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "node-fetch" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "node-fetch" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "node-fetch"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 18,
        file: 'main/getLanguageMap.ts',
        length: 12,
        line: 19,
        lineText: "import fetch from 'node-fetch';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "node-fetch" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "node-fetch" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "node-fetch"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 50,
        file: 'main/registerAppLifecycleListeners.ts',
        length: 29,
        line: 2,
        lineText: "import installExtension, { VUEJS3_DEVTOOLS } from 'electron-devtools-installer';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "electron-devtools-installer" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "electron-devtools-installer" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "electron-devtools-installer"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 40,
        file: 'main/registerAutoUpdaterListeners.ts',
        length: 18,
        line: 2,
        lineText: "import { autoUpdater, UpdateInfo } from 'electron-updater';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "electron-updater" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "electron-updater" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "electron-updater"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 28,
        file: 'main/registerIpcMainActionListeners.ts',
        length: 18,
        line: 9,
        lineText: "import { autoUpdater } from 'electron-updater';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "electron-updater" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "electron-updater" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "electron-updater"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 15,
        file: 'main/registerIpcMainActionListeners.ts',
        length: 10,
        line: 11,
        lineText: "import fs from 'fs-extra';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "fs-extra" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "fs-extra" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "fs-extra"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 26,
        file: 'schemas/index.ts',
        length: 8,
        line: 2,
        lineText: "import { cloneDeep } from 'lodash';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "lodash" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "lodash" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "lodash"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 22,
        file: 'utils/index.ts',
        length: 6,
        line: 2,
        lineText: "import { Money } from 'pesa';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "pesa" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "pesa" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "pesa"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 25,
        file: 'utils/misc.ts',
        length: 7,
        line: 1,
        lineText: "import { DateTime } from 'luxon';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: {
            column: 31,
            file: '../../.pnp.cjs',
            length: 437,
            line: 2630,
            lineText: '        "packageDependencies": [\\',
            namespace: '',
            suggestion: ''
          },
          text: `The Yarn Plug'n'Play manifest forbids importing "luxon" here because it's not listed as a dependency of this package:`
        },
        {
          location: null,
          text: 'You can mark the path "luxon" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "luxon"'
    }
  ],
  warnings: []
}

Node.js v18.16.1

Steps to Reproduce

  1. fork
  2. git clone
  3. cd
  4. yarn
  5. yarn dev

Tried:

rm -rf node_modules

yarn

yarn dev

FrappeBooks Version

0.21.2

Path or Feature name

root

Country

Canada

Language

EN

OS

Macos (Intel)

Additional OS Info

Sonoma 14.1.1