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

nx build doesn't work with angular 13 #7549

Closed
SvetlanaMuravlova opened this issue Oct 28, 2021 · 5 comments
Closed

nx build doesn't work with angular 13 #7549

SvetlanaMuravlova opened this issue Oct 28, 2021 · 5 comments

Comments

@SvetlanaMuravlova
Copy link

SvetlanaMuravlova commented Oct 28, 2021

Current Behavior

I can't generate a new library with command ng generate @nrwl/angular:library
if i create this library manually i can't build any lib

Steps to Reproduce

https://github.com/SvetlanaMuravlova/angula-13/tree/nx-lib
In this repository you can find a project (branch nx-lib, angular 13 with nx 13.1.0)
if you will try to build an example lib you will get such error

on branch ng-library you can find a library which was generated with ng and everything works correctly

Failure Logs

image

Must use import to load ES Module: /home/vs/Project/for_cli/angula-13/node_modules/@angular/compiler-cli/bundles/index.js
require() of ES modules is not supported.
require() of /home/vs/Project/for_cli/angula-13/node_modules/@angular/compiler-cli/bundles/index.js from /home/vs/Project/for_cli/angula-13/node_modules/@nrwl/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/vs/Project/for_cli/angula-13/node_modules/@angular/compiler-cli/package.json.

Environment

"dependencies": {
"@angular/animations": "next",
"@angular/common": "next",
"@angular/compiler": "next",
"@angular/core": "next",
"@angular/forms": "next",
"@angular/platform-browser": "next",
"@angular/platform-browser-dynamic": "next",
"@angular/router": "next",
"@nrwl/workspace": "13.1.0",
"@nrwl/angular": "13.1.0",
"rxjs": "~7.4.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "next",
"@angular/cli": "next",
"@angular/compiler-cli": "next",
"@nrwl/workspace": "13.1.0",
"@nrwl/cli": "13.1.0",
"@nrwl/devkit": "13.1.0",
"@types/jasmine": "~3.10.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.10.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.4.3"
}

@vsavkin
Copy link
Member

vsavkin commented Oct 28, 2021

Hi there. Thank you for submitting the issue!

We are planning to release Nx 13.2 with Angular 13 support once Angular 13 is out (which is I believe next week).

@vsavkin vsavkin closed this as completed Oct 28, 2021
@SvetlanaMuravlova
Copy link
Author

@vsavkin Got it) thank you for your product)

@hugoebarboza
Copy link

I have the same issue, any update ? I just migrate from Angular 12 to 13...:(

@krokofant
Copy link

Why is this closed if support hasn't landed yet? A bit confusing. It can't be tracked really.

@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 Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants