-
Notifications
You must be signed in to change notification settings - Fork 27.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: force module format for virtual client-proxy file #74162
base: canary
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react' | ||
|
||
import EsmFromCjs from 'lib-cjs' | ||
|
||
export default function Page() { | ||
return ( | ||
<p> | ||
lib-cjs: <EsmFromCjs /> | ||
</p> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react' | ||
|
||
import EsmFromEsm from 'lib-esm' | ||
|
||
export default function Page() { | ||
return ( | ||
<p> | ||
lib-esm: <EsmFromEsm /> | ||
</p> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ReactNode } from 'react' | ||
export default function Root({ children }: { children: ReactNode }) { | ||
return ( | ||
<html> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react' | ||
|
||
const CjsFromCjs = require('lib-cjs') | ||
|
||
export default function Page() { | ||
return ( | ||
<p> | ||
lib-cjs: <CjsFromCjs /> | ||
</p> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react' | ||
|
||
const CjsFromEsm = require('lib-esm') | ||
|
||
export default function Page() { | ||
return ( | ||
<p> | ||
lib-esm: <CjsFromEsm /> | ||
</p> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { nextTestSetup } from 'e2e-utils' | ||
|
||
describe('esm-client-module-without-exports', () => { | ||
const { next } = nextTestSetup({ | ||
files: __dirname, | ||
}) | ||
|
||
describe('"type": "commonjs" in package.json', () => { | ||
it('should render without errors: import cjs', async () => { | ||
const $ = await next.render$('/import-cjs') | ||
expect($('p').text()).toContain('lib-cjs: esm') | ||
}) | ||
|
||
it('should render without errors: require cjs', async () => { | ||
const $ = await next.render$('/require-cjs') | ||
expect($('p').text()).toContain('lib-cjs: cjs') | ||
}) | ||
}) | ||
|
||
describe('"type": "module" in package.json', () => { | ||
it('should render without errors: import esm', async () => { | ||
const $ = await next.render$('/import-esm') | ||
expect($('p').text()).toContain('lib-esm: esm') | ||
}) | ||
|
||
it('should render without errors: require esm', async () => { | ||
const $ = await next.render$('/require-esm') | ||
expect($('p').text()).toContain('lib-esm: cjs') | ||
}) | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* @type {import('next').NextConfig} | ||
*/ | ||
const nextConfig = {} | ||
|
||
module.exports = nextConfig |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the case that matches what happened with
jotai
. other permutations are just for completeness.