Why generating an app with @nx/next does not produce recommended tsconfigs? #32333
Unanswered
egorkarimov
asked this question in
Questions
Replies: 2 comments
-
my guess is we could do a PR to update the templates. there are other things as well that are being generated with outdated structure. currently , our solution was creating custom generators that the team will be using |
Beta Was this translation helpful? Give feedback.
0 replies
-
I just noticed that the nx structure (tsconfig.json + tsconfig.app.json) for tsconfigs breaks nextjs linter. ➜ myapp git:(main) ✗ pnpm --filter myapp-web lint
> [email protected] lint /…/apps/myapp-web
> next lint
/…/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/build/next-config-ts/transpile-config.js:16
const resolvedBaseUrl = (0, _nodepath.join)(cwd, compilerOptions.baseUrl ?? '.');
... ^ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Why generating a lib or a react app
nx g @nx/react:app
and generating next app vianx g @nx/next:app
produces different tsconfigs?In the first case, I get
tsconfig.json
andtsconfig.app.json
as it is recommended in TS Linking docs (https://nx.dev/concepts/typescript-project-linking). However, for nextjs I get a singletsconfig.json
.Additionally, in TS Linking docs there is no description on apps' tsconfigs — only libs. That's why I am not sure about the
configName
property in the workspace root tsconfig.json:Can you explain?
UPD: I understood, that this configuration is relevant only for @nx/js plugin; other plugins do not follow @nx/js configName convention.
I also experimented and generated nextjs app (
nx g @nx/next:app
) with unit and e2e tests. With e2e enabled, it generatestsconfig.spec.json
, but reference is flipped. Usually, maintsconfig.json
would reference additional specific configs, but not in this case:Why is that?
Beta Was this translation helpful? Give feedback.
All reactions