Repository: next.js
Issue: modularizeImports error with ahooks when using 13.5.2
Labels: bug

### Link to the code that reproduces this issue

https://github.com/lobehub/lobe-chat/tree/chore/upgrade-nextjs

### To Reproduce

1. pnpm i 
2. npm start ,and open url

then you will see:
```
/Users/wenbing/CodeProjects/LobeHub/lobe-
chat/node_modules/.pnpm/ahooks@3.7.8_react@18.2.0/node_modules/ahooks/es/useScroll/index.js:1
import { __read } from "tslib";
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:74:18)
    at wrapSafe (node:internal/modules/cjs/loader:1141:20)
    at Module._compile (node:internal/modules/cjs/loader:1182:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at mod.require (/Users/wenbing/CodeProjects/LobeHub/lobe-chat/node_modules/.pnpm/next@13.5.2_@babel+core@7.22.20_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/require-hook.js:64:28)
    at require (node:internal/modules/cjs/helpers:103:18)
    at ahooks/es/useScroll (/Users/wenbing/CodeProjects/LobeHub/lobe-chat/.next/server/pages/_document.js:562:18)
    at __webpack_require__ (/Users/wenbing/CodeProjects/LobeHub/lobe-chat/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///./node_modules/.pnpm/@lobehub+ui@1.95.0_@types+react-dom@18.2.7_@types+react@18.2.22_@types+three@0.156.0_antd-sty_dzdvltms4vzrnviadbp4ksmeeu/node_modules/@lobehub/ui/es/BackBottom/index.js:7:77)
    at ./node_modules/.pnpm/@lobehub+ui@1.95.0_@types+react-dom@18.2.7_@types+react@18.2.22_@types+three@0.156.0_antd-sty_dzdvltms4vzrnviadbp4ksmeeu/node_modules/@lobehub/ui/es/BackBottom/index.js (/Users/wenbing/CodeProjects/LobeHub/lobe-chat/.next/server/vendor-chunks/@lobehub+ui@1.95.0_@types+react-dom@18.2.7_@types+react@18.2.22_@types+three@0.156.0_antd-sty_dzdvltms4vzrnviadbp4ksmeeu.js:80:1)
    at __webpack_require__ (/Users/wenbing/CodeProjects/LobeHub/lobe-chat/.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///./node_modules/.pnpm/@lobehub+ui@1.95.0_@types+react-dom@18.2.7_@types+react@18.2.22_@types+three@0.156.0_antd-sty_dzdvltms4vzrnviadbp4ksmeeu/node_modules/@lobehub/ui/es/index.js:93:69) {
  page: '/chat'
}
```
### Current vs. Expected behavior

can run correct with ahooks.



### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103
    Binaries:
      Node: 18.13.0
      npm: 8.19.3
      Yarn: 1.22.19
      pnpm: 8.3.1
    Relevant Packages:
      next: 13.5.2
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.2.2
    Next.js Config:
      output: N/A
```


### Which area(s) are affected? (Select all that apply)

Not sure

### Additional context

I make sure this problem is due to wrong ahooks config:

https://github.com/vercel/next.js/blob/619f113870aad84b1d5a874391e222136a85ee8e/packages/next/src/server/config.ts#L698

it should be `'*': 'ahooks/lib/{{member}}'`

but it can still work with 13.4.7