Skip to content

Commit 320986a

Browse files
DavidBabelijjk
andauthored
Update next.config.js (#33091)
## Feature We are in a Typescript context, but the `next.config.js` cannot be parsed as is, since it fails on `File is a CommonJS module; it may be converted to an ES module.ts(80001)` so it does not parse the rest of the file : ![image](https://user-images.githubusercontent.com/5599375/148612812-de50b5d9-609e-4273-9892-5b3a4ad0b282.png) Here we should have an error because the type is not the expected one. With a little trick, it's possible to enable the check by : - adding `// @ts-check` at first line - moving the export at the end of the file And then it works like a charm : ![image](https://user-images.githubusercontent.com/5599375/148612666-ae5350d8-f16e-45e0-84e4-b31faf07fcca.png) Co-authored-by: JJ Kasper <[email protected]>
1 parent 3861e4b commit 320986a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/** @type {import('next').NextConfig} */
2-
module.exports = {
2+
const nextConfig = {
33
reactStrictMode: true,
44
}
5+
6+
module.exports = nextConfig

0 commit comments

Comments
 (0)