nx: Error: (0 , _identifier.getUndoPath) is not a function

Current Behavior

I am trying to build my Angular Ionic application and followed this guide here: https://ionicframework.com/blog/ionic-angular-monorepos-with-nx/

Unfortunately I am getting the below error when running nx build:

styles.5c56ab7b989b0bb258f7.css - Error: (0 , _identifier.getUndoPath) is not a function

Expected Behavior

Steps to Reproduce

Follow this guide:

https://ionicframework.com/blog/ionic-angular-monorepos-with-nx/

Failure Logs

; nx build

> nx run entergon:build:production
✔ Browser application bundle generation complete.

styles.5c56ab7b989b0bb258f7.css - Error: (0 , _identifier.getUndoPath) is not a function



———————————————————————————————————————————————

>  NX   ERROR  Running target "entergon:build" failed

  Failed tasks:

  - entergon:build:production

  Hint: run the command with --verbose for more details.

Environment

nx : 12.6.4 @nrwl/angular : 12.6.4 @nrwl/cli : 12.6.4 @nrwl/cypress : 12.6.4 @nrwl/devkit : 12.6.4 @nrwl/eslint-plugin-nx : 12.6.4 @nrwl/express : Not Found @nrwl/jest : 12.6.4 @nrwl/linter : 12.6.4 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/nx-cloud : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 12.6.4 @nrwl/web : Not Found @nrwl/workspace : 12.6.4 @nrwl/storybook : 12.6.4 @nrwl/gatsby : Not Found typescript : 4.3.5

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 19

Commits related to this issue

Most upvoted comments

I managed to fix an already created Angular project by manually updating package.json.

I simply changed "@angular-devkit/build-angular": "^12.1.0" to "@angular-devkit/build-angular": "~12.1.0", then ran npm install.

Now build is working.

We just published 12.6.5 with a fix. Please use that version 😄

@FrozenPandaz Issue still exists in 12.6.5 and probably not related to NX.

I managed to fix an already created Angular project by manually updating package.json.

I simply changed "@angular-devkit/build-angular": "^12.1.0" to "@angular-devkit/build-angular": "~12.1.0", then ran npm install.

Now build is working.

Downgrading @angular-devkit/build-angular to 12.1.0 worked for me. Thanks @Hakhenaton

@muuvmuuv my hotfix: add your package.json devDependencies: “mini-css-extract-plugin”: “2.2.0” and work build

I got the same exact problem. I’ve generated a new nx workspace with angular and this error occurs. What seems to “work” is to remove the "styles" attribute from the angular.json file. This is no option however, because we need global styles 😅. Having a project with CSS or SCSS makes no difference and generates the same error.

Installing of “mini-css-extract-plugin”: “2.2.0” worked for me. I used the current latest 12.7.2 version of nx. Thanks @eggp a lot!

Hi all, sorry for the inconvenience. We are looking into this.

Meanwhile, I found the following to work after creating a new workspace.

1. rm -rf node_modules package-lock.json // Delete package-lock.json and node_modules 2. npm i // Install again

Things should work again. If not, please post the results of npm ls webpack