Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d8bfa7b1
Unverified
Commit
d8bfa7b1
authored
Jun 21, 2022
by
JJ Kasper
Committed by
GitHub
Jun 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile time log after error (#37863)
parent
8e28be0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletion
+37
-1
store.ts
packages/next/build/output/store.ts
+1
-1
hmr.test.ts
test/development/basic/hmr.test.ts
+36
-0
No files found.
packages/next/build/output/store.ts
View file @
d8bfa7b1
...
...
@@ -88,7 +88,7 @@ store.subscribe((state) => {
return
}
}
startTime
=
0
// Ensure traces are flushed after each compile in development mode
flushAllTraces
()
teardownTraceSubscriber
()
...
...
test/development/basic/hmr.test.ts
View file @
d8bfa7b1
...
...
@@ -791,4 +791,40 @@ describe('basic HMR', () => {
expect
(
traceData
).
toContain
(
'client-error'
)
expect
(
traceData
).
toContain
(
'client-success'
)
})
it
(
'should have correct compile timing after fixing error'
,
async
()
=>
{
const
pageName
=
'pages/auto-export-is-ready.js'
const
originalContent
=
await
next
.
readFile
(
pageName
)
try
{
const
browser
=
await
webdriver
(
next
.
url
,
'/auto-export-is-ready'
)
const
outputLength
=
next
.
cliOutput
.
length
await
next
.
patchFile
(
pageName
,
`import hello from 'non-existent'\n`
+
originalContent
)
expect
(
await
hasRedbox
(
browser
,
true
)).
toBe
(
true
)
await
waitFor
(
3000
)
await
next
.
patchFile
(
pageName
,
originalContent
)
await
check
(
()
=>
next
.
cliOutput
.
substring
(
outputLength
),
/compiled.*
?
successfully/i
)
const
compileTime
=
next
.
cliOutput
.
substring
(
outputLength
)
.
match
(
/compiled.*
?
successfully in
([\d
.
]{1,})\s?(?:
s|ms
)
/i
)
let
compileTimeMs
=
parseFloat
(
compileTime
[
1
])
if
(
next
.
cliOutput
.
substring
(
outputLength
)
.
match
(
/compiled.*
?
successfully in
([\d
.
]{1,})\s?
s/
)
)
{
compileTimeMs
=
compileTimeMs
*
1000
}
expect
(
compileTimeMs
).
toBeLessThan
(
3000
)
}
finally
{
await
next
.
patchFile
(
pageName
,
originalContent
)
}
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment