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

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

Open
Nelfimov opened this issue Jul 3, 2024 · 5 comments
Open

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

Nelfimov opened this issue Jul 3, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Nelfimov
Copy link
Member

Nelfimov commented Jul 3, 2024

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

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

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

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

  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 Nelfimov added the bug Something isn't working label Jul 3, 2024
@Nelfimov Nelfimov self-assigned this Jul 3, 2024
@Nelfimov
Copy link
Member Author

Nelfimov commented Jul 3, 2024

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

@monstrs
Copy link
Contributor

monstrs commented Jul 3, 2024

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

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

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

@Nelfimov
Copy link
Member Author

Nelfimov commented Jul 3, 2024

@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
Copy link
Contributor

monstrs commented Jul 4, 2024

@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
Copy link
Member Author

Nelfimov commented Jul 4, 2024

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


Исправлено

  • service ...
  • image pack

Осталось разобраться почему тут 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 - решило только часть проблемы.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants