Skip to content

Commit

Permalink
fix gsp tracing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ztanner committed Oct 30, 2023
1 parent 3248ee7 commit 3bde9be
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/src/build/collect-build-traces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ export async function collectBuildTraces({

const sharedIgnores = [
'**/next/dist/compiled/next-server/**/*.dev.js',
'**/node_modules/react{,-dom,-dom-server-turbopack}/**/*.development.js',
isStandalone ? null : '**/next/dist/compiled/jest-worker/**/*',
'**/next/dist/compiled/webpack/(bundle4|bundle5).js',
'**/node_modules/webpack5/**/*',
Expand Down Expand Up @@ -294,6 +293,7 @@ export async function collectBuildTraces({

const serverIgnores = [
...sharedIgnores,
'**/node_modules/react{,-dom,-dom-server-turbopack}/**/*.development.js',
'**/*.d.ts',
'**/*.map',
'**/next/dist/pages/**/*',
Expand Down
15 changes: 15 additions & 0 deletions test/e2e/app-dir/app/pages/gsp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import useSWR from 'swr'

console.log(useSWR)

export default function Home() {
return <h1>Hello</h1>
}

export async function getStaticProps() {
return {
props: {
foo: 'bar',
},
}
}
5 changes: 5 additions & 0 deletions test/e2e/app-dir/app/standalone.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
killApp,
fetchViaHTTP,
} from 'next-test-utils'
import { waitFor } from '../../../lib/next-test-utils'

if (!(globalThis as any).isNextStart) {
it('should skip for non-next start', () => {})
Expand All @@ -17,6 +18,9 @@ if (!(globalThis as any).isNextStart) {
{
files: __dirname,
skipStart: true,
dependencies: {
swr: 'latest',
},
},
({ next }) => {
beforeAll(async () => {
Expand Down Expand Up @@ -90,6 +94,7 @@ if (!(globalThis as any).isNextStart) {
'/dashboard/hello',
'/dashboard/project/123',
'/catch-all/first',
'/gsp',
]) {
const res = await fetchViaHTTP(appPort, testPath)
expect(res.status).toBe(200)
Expand Down

0 comments on commit 3bde9be

Please sign in to comment.