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

Cannot use TypeScript Paths in @nrwl/angular:module-federation-dev-server #15561

Closed
muuvmuuv opened this issue Mar 9, 2023 · 1 comment · Fixed by #15638
Closed

Cannot use TypeScript Paths in @nrwl/angular:module-federation-dev-server #15561

muuvmuuv opened this issue Mar 9, 2023 · 1 comment · Fixed by #15638
Assignees
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug

Comments

@muuvmuuv
Copy link
Contributor

muuvmuuv commented Mar 9, 2023

Current Behavior

I had used "@angular-builders/custom-webpack:dev-server" before to be able to use a TypeScript paths in webpack config, but we are now trying out module federation and I have to switch. Unfortunately, TypeScript paths does not work with "@nrwl/angular:module-federation-dev-server" and it prints:

 >  NX   ⨯ Unable to compile TypeScript:

   apps/project/webpack.config.ts:4:29 - error TS2307: Cannot find module '@project/app-info' or its corresponding type declarations.

   4 import { releaseName } from "@project/app-info"
                                 ~~~~~~~~~~~~~~~~~~~~
   apps/project/webpack.config.ts:5:30 - error TS2307: Cannot find module '@project/webpack' or its corresponding type declarations.

   5 import { createConfig } from "@project/webpack"
                                  ~~~~~~~~~~~~~~~~~~~
   apps/project/webpack.config.ts:7:48 - error TS7006: Parameter 'config' implicitly has an 'any' type.

   7 export default createConfig("project", async (config) => {
                                                    ~~~~~~
   apps/project/webpack.config.ts:35:28 - error TS7016: Could not find a declaration file for module './module-federation.config'. '/Users/marvin/Developer/project/app/apps/project/module-federation.config.js' implicitly has an 'any' type.

   35   const mfc = await import("./module-federation.config")

Expected Behavior

Same experience

GitHub Repo

No response

Steps to Reproduce

  1. try to import a ts lib in your project into a ts webpack config

Nx Report

Node : 18.15.0
   OS   : darwin arm64
   pnpm : 7.29.1

   nx                      : 15.8.5
   @nrwl/js                : 15.8.5
   @nrwl/jest              : 15.8.5
   @nrwl/linter            : 15.8.5
   @nrwl/workspace         : 15.8.5
   @nrwl/angular           : 15.8.5
   @nrwl/cli               : 15.8.5
   @nrwl/cypress           : 15.8.5
   @nrwl/devkit            : 15.8.5
   @nrwl/eslint-plugin-nx  : 15.8.5
   @nrwl/tao               : 15.8.5
   @nrwl/webpack           : 15.8.5
   typescript              : 4.9.5
   ---------------------------------------
   Community plugins:
   @ionic/angular           : 6.6.0
   ngx-extended-pdf-viewer  : 16.2.5
   @compodoc/compodoc       : 1.1.19
   @ionic/angular-toolkit   : 8.0.0
   @nxext/capacitor         : 15.7.0
   @nxext/ionic-angular     : 15.6.0
   @testing-library/angular : 13.3.0
   nx-stylelint             : 15.0.0

Failure Logs

No response

Additional Information

No response

@muuvmuuv muuvmuuv changed the title Cannot use TypeScript in @angular-builders/custom-webpack:dev-server Cannot use TypeScript Paths in @angular-builders/custom-webpack:dev-server Mar 9, 2023
@muuvmuuv muuvmuuv changed the title Cannot use TypeScript Paths in @angular-builders/custom-webpack:dev-server Cannot use TypeScript Paths in @nrwl/angular:module-federation-dev-server Mar 9, 2023
@AgentEnder AgentEnder added the scope: angular Issues related to Angular support in Nx label Mar 10, 2023
@leosvelperez leosvelperez self-assigned this Mar 13, 2023
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants