atls / raijin

Atlantis working toolset
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Ошибки нового бандла #350

Open Nelfimov opened 6 days ago

Nelfimov commented 6 days ago

Описание бага

Запуск нового бандла в проекте падает с ошибками.

Бандл приложил с сорс мапами и без минификации.

Воспроизведение

  1. https://github.com/rees46/shopify-app/tree/chore/new-bundle
  2. yarn install

Ожидаемое поведение

Ошибок нет

Материалы

/Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/releases/yarn.cjs:85672
              throw ex;
              ^

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received undefined
    at new NodeError (node:internal/errors:399:5)
    at createRequire (node:internal/modules/cjs/loader:1396:11)
    at /Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/releases/yarn.cjs:448933:55
    at Object.<anonymous> (/Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/releases/yarn.cjs:457966:3)
    at Module._compile (node:internal/modules/cjs/loader:1275:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
    at Module.load (node:internal/modules/cjs/loader:1133:32)
    at Module._load (node:internal/modules/cjs/loader:972:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'ERR_INVALID_ARG_VALUE'
}

Node.js v19.9.0

Данные окружения

  1. https://github.com/rees46/shopify-app/tree/chore/new-bundle
Nelfimov commented 6 days ago

@monstrs если будет возможность - посмотри плиз.

monstrs commented 6 days ago

@monstrs если будет возможность - посмотри плиз.

https://github.com/monstrs-lab/tools/blob/master/.yarn/patches/lint-staged-npm-13.2.2-e66c493ac4.patch

скорее всего из-за этого

Nelfimov commented 6 days ago

@monstrs спасибо, помогло!

Сейчас ошибка при запуске yarn service ...:

┌ Service build
➤ YN0000: │ Your application tried to access @atls/code-runtime, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
➤ YN0000: │ 
➤ YN0000: │ Required package: @atls/code-runtime (via "@atls/code-runtime/webpack")
➤ YN0000: │ Required by: /Users/nikoroach/Documents/Dev/REES/rees-shopify-app/worker/entrypoints/service-entrypoint/.yarn/dist/793237230.mjs

При том что в корне @atls/code-runtime установлен

https://github.com/rees46/shopify-app/blob/61f225ff6b78f5e2a831c128545bfd00fe0eb83f/package.json#L11

monstrs commented 6 days ago

@monstrs спасибо, помогло!

Сейчас ошибка при запуске yarn service ...:

┌ Service build
➤ YN0000: │ Your application tried to access @atls/code-runtime, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
➤ YN0000: │ 
➤ YN0000: │ Required package: @atls/code-runtime (via "@atls/code-runtime/webpack")
➤ YN0000: │ Required by: /Users/nikoroach/Documents/Dev/REES/rees-shopify-app/worker/entrypoints/service-entrypoint/.yarn/dist/793237230.mjs

При том что в корне @atls/code-runtime установлен

https://github.com/rees46/shopify-app/blob/61f225ff6b78f5e2a831c128545bfd00fe0eb83f/package.json#L11

@monstrs спасибо, помогло!

Сейчас ошибка при запуске yarn service ...:

┌ Service build
➤ YN0000: │ Your application tried to access @atls/code-runtime, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
➤ YN0000: │ 
➤ YN0000: │ Required package: @atls/code-runtime (via "@atls/code-runtime/webpack")
➤ YN0000: │ Required by: /Users/nikoroach/Documents/Dev/REES/rees-shopify-app/worker/entrypoints/service-entrypoint/.yarn/dist/793237230.mjs

При том что в корне @atls/code-runtime установлен

https://github.com/rees46/shopify-app/blob/61f225ff6b78f5e2a831c128545bfd00fe0eb83f/package.json#L11

у тебя почему-то варкер распаковывается в воркспейс rees46/shopify-app/custom-app/entrypoints/service-entrypoint/.yarn/dist/793237230.mjs а должен в rees46/shopify-app/custom-app/.yarn/dist/793237230.mjs соответственно там нет runtime

Nelfimov commented 5 days ago

@monstrs там был некорреткно указан путь для инициализации воркера. Поправил


Исправлено

Осталось разобраться почему тут https://github.com/rees46/shopify-app/tree/chore/new-bundle в обоих сервисах service build и service dev падает с ошибкой зависимостей/декораторов:

/Users/nikoroach/.nvm/versions/node/v19.9.0/bin/node /Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/releases/yarn.cjs run dev
➤ YN0000: ┌ Service Development
➤ YN0000: │  Starting server...
➤ YN0000: │  [Nest] 2204  - 07/04/2024, 12:57:52 PM     LOG [NestFactory] Starting Nest application...
➤ YN0000: │  [Nest] 2204  - 07/04/2024, 12:57:52 PM     LOG [InstanceLoader] WorkerServiceEntrypointModule dependencies initialized +16ms
➤ YN0000: │  [Nest] 2204  - 07/04/2024, 12:57:52 PM     LOG [InstanceLoader] ShopifyWorkerCqrsAdapterModule dependencies initialized +0ms
➤ YN0000: │  [Nest] 2204  - 07/04/2024, 12:57:52 PM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
➤ YN0000: │  [shopify-api/INFO] version 9.7.2, environment Node v19.9.0
➤ YN0000: │  [Nest] 2204  - 07/04/2024, 12:57:52 PM   ERROR [ExceptionHandler] Nest can't resolve dependencies of the ExplorerService (?). Please make sure that the 
➤ YN0000: │  argument ModulesContainer at index [0] is available in the CqrsModule context.
➤ YN0000: │  Potential solutions:
➤ YN0000: │  - Is CqrsModule a valid NestJS module?
➤ YN0000: │  - If ModulesContainer is a provider, is it part of the current CqrsModule?
➤ YN0000: │  - If ModulesContainer is exported from a separate @Module, is that module imported within CqrsModule?
➤ YN0000: │    @Module({
➤ YN0000: │      imports: [ /* the Module containing ModulesContainer */ ]
➤ YN0000: │    })
➤ YN0000: │  
➤ YN0000: │  Error: Nest can't resolve dependencies of the ExplorerService (?). Please make sure that the argument ModulesContainer at index [0] is available in the
➤ YN0000: │  CqrsModule context.
➤ YN0000: │  Potential solutions:
➤ YN0000: │  - Is CqrsModule a valid NestJS module?
➤ YN0000: │  - If ModulesContainer is a provider, is it part of the current CqrsModule?
➤ YN0000: │  - If ModulesContainer is exported from a separate @Module, is that module imported within CqrsModule?
➤ YN0000: │    @Module({
➤ YN0000: │      imports: [ /* the Module containing ModulesContainer */ ]
➤ YN0000: │    })
➤ YN0000: │      at Injector.lookupComponentInParentModules
➤ YN0000: │  (/Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/unplugged/@nestjs-core-virtual-0f92a9cf47/node_modules/@nestjs/core/injector/injector.js:254:19)
➤ YN0000: │      at async Injector.resolveComponentInstance
➤ YN0000: │  (/Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/unplugged/@nestjs-core-virtual-0f92a9cf47/node_modules/@nestjs/core/injector/injector.js:207:33)
➤ YN0000: │      at async resolveParam
➤ YN0000: │  (/Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/unplugged/@nestjs-core-virtual-0f92a9cf47/node_modules/@nestjs/core/injector/injector.js:128:38)
➤ YN0000: │      at async Promise.all (index 0)
➤ YN0000: │      at async Injector.resolveConstructorParams
➤ YN0000: │  (/Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/unplugged/@nestjs-core-virtual-0f92a9cf47/node_modules/@nestjs/core/injector/injector.js:143:27)
➤ YN0000: │      at async Injector.loadInstance
➤ YN0000: │  (/Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/unplugged/@nestjs-core-virtual-0f92a9cf47/node_modules/@nestjs/core/injector/injector.js:70:13)
➤ YN0000: │      at async Injector.loadProvider
➤ YN0000: │  (/Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/unplugged/@nestjs-core-virtual-0f92a9cf47/node_modules/@nestjs/core/injector/injector.js:97:9)
➤ YN0000: │      at async /Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/unplugged/@nestjs-core-virtual-0f92a9cf47/node_modules/@nestjs/core/injector/instanc
➤ YN0000: │  e-loader.js:56:13
➤ YN0000: │      at async Promise.all (index 8)
➤ YN0000: │      at async InstanceLoader.createInstancesOfProviders (/Users/nikoroach/Documents/Dev/REES/rees-shopify-app/.yarn/unplugged/@nestjs-core-virtual-0f92a9cf47
➤ YN0000: │  /node_modules/@nestjs/core/injector/instance-loader.js:55:9)

У старого бандла проблем не было.

Переписал конфиг вебпака на нативный, без использования chain - решило только часть проблемы.