mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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.
11 lines
319 B
JavaScript
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>
|
|
}
|