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

File conventions are applied inside private folders #64162

Open
AdisonCavani opened this issue Apr 7, 2024 · 1 comment · May be fixed by #64177
Open

File conventions are applied inside private folders #64162

AdisonCavani opened this issue Apr 7, 2024 · 1 comment · May be fixed by #64177
Labels
bug Issue was opened via the bug report template. TypeScript Related to types with Next.js.

Comments

@AdisonCavani
Copy link

AdisonCavani commented Apr 7, 2024

Link to the code that reproduces this issue

https://github.com/AdisonCavani/nextjs-file-conv-minimal-reproduction

To Reproduce

  1. Run build: next build
  2. See error:
> build
> next build

 ✓ Creating an optimized production build
 ✓ Compiled successfully
   Linting and checking validity of types  ..Failed to compile.

.next/types/app/_components/page.ts:26:13
Type error: Type 'OmitWithTag<Props, keyof PageProps, "default">' does not satisfy the constraint '{ [x: string]: never; }'.
  Property 'className' is incompatible with index signature.
    Type 'string' is not assignable to type 'never'.

  24 |
  25 | // Check the prop type of the entry function
> 26 | checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
     |             ^
  27 |
  28 | // Check the arguments and return type of the generateMetadata function
  29 | if ('generateMetadata' in entry) {

Current vs. Expected behavior

File conventions should not be applied inside private folders (with _ prefix).

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 16296
  Available CPU cores: 12
Binaries:
  Node: 21.7.1
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.2.0-canary.61 // Latest available version is detected (14.2.0-canary.61).
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

App Router, TypeScript (plugin, built-in types)

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

When I rename the _components/page.tsx to anything other, eg.: _components/page-comp.tsx the error disappears.

@AdisonCavani AdisonCavani added the bug Issue was opened via the bug report template. label Apr 7, 2024
@github-actions github-actions bot added the TypeScript Related to types with Next.js. label Apr 7, 2024
@lovelyJason
Copy link

这个bug是怎么解决的,没办法next build啊,next dev是正常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. TypeScript Related to types with Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants