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

Adding tsconfig to project.json breaks starting applications #22979

Open
1 of 4 tasks
timothylombrana opened this issue Apr 24, 2024 · 1 comment
Open
1 of 4 tasks

Adding tsconfig to project.json breaks starting applications #22979

timothylombrana opened this issue Apr 24, 2024 · 1 comment
Assignees
Labels
blocked: repro needed scope: module federation Issues related to module federation support type: bug

Comments

@timothylombrana
Copy link

Current Behavior

I recently migrated to latest NX workspace, while running migration I got a warning it couldn't update several libraries. After looking into the warning I read it was due to missing tsconfig library reference in project.json files. I dumped all my changes, added all respective key/value pairs for files. Ran the migration again, worked as expected. After starting my services a few times it now wont start, gives the following error.

Screenshot 2024-04-24 at 11 17 43 AM

If I stash my changes to all the project.json files that error goes away but I also do get the warnings again when running my jest tests.

Option "tsConfig" is deprecated: Use the ts-jest configuration options in the jest config file instead.

Expected Behavior

I should be able to start my services and run my tests without errors or warnings.

GitHub Repo

No response

Steps to Reproduce

  1. Migrated from NX 16 to 18
  2. yarn start ... gets error
  3. yarn test give warnings

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.12.2
OS     : darwin-arm64
yarn   : 4.1.1

nx (global)        : 18.3.3
nx                 : 18.3.3
@nx/js             : 18.3.3
@nx/jest           : 18.3.3
@nx/linter         : 18.3.3
@nx/eslint         : 18.3.3
@nx/workspace      : 18.3.3
@nx/angular        : 18.3.3
@nx/devkit         : 18.3.3
@nx/eslint-plugin  : 18.3.3
@nx/playwright     : 18.3.3
@nrwl/tao          : 18.3.3
@nx/web            : 18.3.3
@nx/webpack        : 18.3.3
nx-cloud           : 18.0.0
typescript         : 5.4.5
---------------------------------------
Community plugins:
ng-mocks : 14.12.2

Failure Logs

❯ yarn start --verbose

> nx run dashboard:serve:development


 NX   Cannot read properties of undefined (reading 'startsWith')


TypeError: Cannot read properties of undefined (reading 'startsWith')
    at getModuleFederationConfig (/Users/l266099/HEB/df-web/node_modules/@nx/webpack/src/utils/module-federation/get-remotes-for-host.js:75:43)
    at moduleFederationDevServerExecutor (/Users/l266099/HEB/df-web/node_modules/@nx/angular/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js:54:86)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getLastValueFromAsyncIterableIterator (/Users/l266099/HEB/df-web/node_modules/nx/src/utils/async-iterator.js:13:19)
    at async iteratorToProcessStatusCode (/Users/l266099/HEB/df-web/node_modules/nx/src/command-line/run/run.js:43:29)
    at async handleErrors (/Users/l266099/HEB/df-web/node_modules/nx/src/utils/params.js:9:16)
    at async process.<anonymous> (/Users/l266099/HEB/df-web/node_modules/nx/bin/run-executor.js:59:28)

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@AgentEnder AgentEnder added the scope: module federation Issues related to module federation support label Apr 29, 2024
@Coly010
Copy link
Contributor

Coly010 commented May 8, 2024

There seems to be multiple things going on here.

  1. When you migrate with Nx from a one version of Nx to a newer version, if you have an angular project using packages like @angular/material, which also contain migrations, they will warn about missing tsConfig options. They can and should be ignored. This is just a difference in how ng upgrade works compared to nx migrate. Everything will still be migrated correctly.

  2. You now have an error showing an issue with Module Federation, but I cannot see any clear reason why you would receive it.

Therefore, I can only investigate further when you provide a reproduction. Please do so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: repro needed scope: module federation Issues related to module federation support type: bug
Projects
None yet
Development

No branches or pull requests

3 participants