Closed ChurroC closed 5 months ago
Its not clear what the issue is here. The configs are behaving exactly as specified.
I ran the --listFiles
after cloning your repro and the result was :
And here is the result with your before 5.5 config:
The only additional file was : c:/temp/next-server-theme/packages/typescript-config/test.ts
because of "**/*.ts"
matched by
packages/typescript-config/test.ts
Matched by include pattern '../../packages/typescript-config/**/*.ts' in 'apps/web/tsconfig.json'
With next.js
as per your first step replaced to
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Next.js",
"extends": "./base.json",
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Bundler",
"allowJs": true,
"jsx": "preserve",
"noEmit": true
},
"include": [
"${configDir}/next-env.d.ts",
"${configDir}/.next/types/**/*.ts",
"${configDir}/**/*.ts",
"${configDir}/**/*.tsx"
],
"exclude": ["${configDir}/node_modules"]
}
i got exactly same list of files as before 5.5
I just checked it out myself and your right. The main problem I keep having is whenever I use the ts config with configDir I get a typeerror of I just can't seem to figure out why this happens or why it only happens when I use configDir. You can just try this out by running dev on the web folder.
Thats not part of typescript stack. Some other tool chain has issues with config dir and you will have to figure out what those are.
@ChurroC Were you able to solve the issue?
@ChurroC Were you able to solve the issue?
I still have the same issue even on 5.5.4
As far as I know nextjs adds in its own custom values to the includes section in the tsconfig which is being messed up by trying to use configDir
🔎 Search Terms
I've been looking through all the configdir issues and pull requests but don't really see anything that pertains to me.
🕗 Version & Regression Information
I used both 5.5 beta and @next but they both had the same error.
⏯ Playground Link
https://codesandbox.io/p/github/ChurroC/next-server-theme/main Install both typescript@next and tsc globally then run tsc -p ./apps/web/tsconfig.json --showConfig
💻 Code
Before 5.5: I had
Which got
This got all the proper files but after 5.5 I tried to do this instead
and had nextjs ts config be
But the probelem I end up happening that the extended ts config becomes
Then I did another test where I modified the nextjs config with
where I added */.ts but this makes the extended have
In this situation ts find the file in */.ts but not the paths with configDir
🙁 Actual behavior
TS should be able to grab all the ts files from the "include" path. But even with configDir it seems to not be able to read the ts file in that directory.
🙂 Expected behavior
I expect ts to be able to run properly in the directory I extended to with configDir and have it read the ts files in that dir.
Additional information about the issue
No response