import_usage inside of compute_import_usage (#95989)
Previously, code such as:
```
export { foo } from "bar"
```
Would contribute to a module's exports (we export foo).
However, it would not contribute to our tracking of imports from "bar".
Therefore we would fall back to the default import usage:
https://github.com/vercel/next.js/blob/c0a7b91becb33490bf412d02bbf09ebaa7216083/turbopack/crates/turbopack-ecmascript/src/references/exports.rs#L140
```rust
pub enum ImportUsage {
#[default]
TopLevel,
Exports(FrozenSet<RcStr>),
}
```
We would therefore not tree-shake. This is rarely a problem with normal
imports / exports because they support following reexports and this is
enabled by default in Turbopack. However, async imports do not support
following reexports.
In https://github.com/vercel/next.js/issues/95698, the import of the
Viem chain definitions is an async-imported module:
<img width="796" height="81" alt="Screenshot 2026-07-20 at 5 47 43 pm"
src="https://github.com/user-attachments/assets/2fc46711-469f-4f28-8369-9c1ea01b808d"
/>
Closes https://github.com/vercel/next.js/issues/95698
I looked at the reproduction from the original issue, and this was the
result:
```
Client graph contains 11/712 viem chain definition files.
Not reproduced; missing 701 definitions.
```
Yay!
Getting Started
Used by some of the world's largest companies, Next.js enables you to create full-stack web applications by extending the latest React features, and integrating powerful Rust-based JavaScript tooling for the fastest builds.
- Visit our Learn Next.js course to get started with Next.js.
- Visit the Next.js Showcase to see more sites built with Next.js.
Documentation
Visit https://nextjs.org/docs to view the full documentation.
Community
The Next.js community can be found on GitHub Discussions where you can ask questions, voice ideas, and share your projects with other people.
To chat with other community members you can join the Next.js Discord server.
Do note that our Code of Conduct applies to all Next.js community channels. Users are highly encouraged to read and adhere to it to avoid repercussions.
Contributing
Contributions to Next.js are welcome and highly appreciated. However, before you jump right into it, we would like you to review our Contribution Guidelines to make sure you have a smooth experience contributing to Next.js.
Good First Issues:
We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place for newcomers and beginners alike to get started, gain experience, and get familiar with our contribution process.
Security
If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and NOT open a public issue.
To participate in our Open Source Software Bug Bounty program, please email [email protected]. We will add you to the program and provide further instructions for submitting your report.