Skip to content

Bug: cannot add transloco to nx project using schematics from docs #844

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

Open
1 task done
swierzbicki opened this issue Mar 24, 2025 · 0 comments
Open
1 task done

Comments

@swierzbicki
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is this a regression?

No

Current behavior

Steps to reproduce:

  1. npx create-nx-workspace@17.3.2 --standaloneApi=false
  2. Angular: Configures a Angular application with modern tooling.
  3. Integrated Monorepo: Nx creates a monorepo that contains multiple projects.
  4. Webpack
  5. Workspace initializing....

Done. Next steps according to docs: https://jsverse.gitbook.io/transloco/getting-started/installation

  1. npm add @jsverse/transloco
  2. nx g @jsverse/transloco:ng-add

Error prompted:

✔ 🌍 Which languages do you need? · en, dk
✔ 🚀 Are you working with server side rendering? (y/N) · false
TypeError: Cannot read properties of undefined (reading 'sourceRoot')
    at /Users/adding-transloco-to-nx/node_modules/@jsverse/transloco/schematics/src/ng-add/index.js:39:36
    at callRuleAsync (/Users/adding-transloco-to-nx/node_modules/@angular-devkit/schematics/src/rules/call.js:77:24)
    at /Users/adding-transloco-to-nx/node_modules/@angular-devkit/schematics/src/rules/call.js:72:40
    at Observable._subscribe (/Users/adding-transloco-to-nx/node_modules/rxjs/dist/cjs/internal/observable/defer.js:8:31)
    at Observable._trySubscribe (/Users/adding-transloco-to-nx/node_modules/rxjs/dist/cjs/internal/Observable.js:41:25)
    at /Users/adding-transloco-to-nx/node_modules/rxjs/dist/cjs/internal/Observable.js:35:31
    at Object.errorContext (/Users/adding-transloco-to-nx/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:22:9)
    at Observable.subscribe (/Users/adding-transloco-to-nx/node_modules/rxjs/dist/cjs/internal/Observable.js:26:24)
    at /Users/adding-transloco-to-nx/node_modules/rxjs/dist/cjs/internal/operators/map.js:9:16
    at OperatorSubscriber.<anonymous> (/Users/adding-transloco-to-nx/node_modules/rxjs/dist/cjs/internal/util/lift.js:14:28)

 >  NX   Cannot read properties of undefined (reading 'sourceRoot')

Expected behavior

transloco should be added

Please provide a link to a minimal reproduction of the bug

https://github.com/swierzbicki/adding-transloco-to-nx

I would like to make a pull request for this bug

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant