Files
Luke SandbergandGitHub e0b2cebde5 Improve the NFT error message and ignore comment handling (#95144)
Fixes #95125 in two ways

The OP admits that they misread the message in a few ways, but we can
fix all of them

1. Be specific about what function might need an annotation in the error
message. A user with a nearby `path.join` might think that that is where
the annotation belongs instead of on the function with the warning.

2. Be more flexible with how these `ignore` comments are interpreted
`fs.readFileSync(path.join(process.cwd(), someVar))` shouldn't require 2
annotations. Handle this by checking for and detecting `turbopackIgnore`
comments in all expressions! This will then bubble up through the linker
and just cause us to ignore corresponding fs access apis.
2026-07-14 08:13:12 +02:00

11 lines
319 B
JavaScript

import joinCwd from './join-cwd'
import { readBareArg, readJoinedArg } from './read-ignored'
export default function Page() {
joinCwd('index.test.ts')
// These use `turbopackIgnore` and must NOT produce a tracing warning.
readBareArg('index.test.ts')
readJoinedArg('index.test.ts')
return <h1>My Page</h1>
}