Files
Jiachi LiuandGitHub a6d4c77f41 Prefer module over main on main fields for app router server compiler (#56960)
Reverts vercel/next.js#56766
Reland vercel/next.js#56532 

x-ref: https://vercel.slack.com/archives/C04DUD7EB1B/p1697576563771229?thread_ts=1697146531.305779&cid=C04DUD7EB1B

This change was breaking package which was actually a dual package but marked as esm module, and when the package is ESM but import a CJS dependency without fully spepcified file path it will fail to resolve. The way is to either remove the esmodule type in package.json or change the import to full path import with extension for the package
2023-10-19 16:06:47 +00:00

20 lines
434 B
JavaScript

import v from 'conditional-exports'
import v1 from 'conditional-exports/subpath'
import { name as serverFieldName } from 'server-module-field'
import Client from './client'
export default function Page() {
return (
<div>
{`Server: ${v}`}
<br />
{`Server subpath: ${v1}`}
<br />
<Client />
<br />
<div id="main-field">{`Server module field: ${serverFieldName}`}</div>
</div>
)
}