Skip to content

Commit 28da802

Browse files
authored
fix(nextjs): correct types conditional export ordering (#12355)
## Description As stated [here](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-referencing) in the typescript docs, `types` exports should always come first, so that they are resolved correctly. This also applies to the nested `types` within and `exports` condition. This corrects an issue where `eslint-import-resolver-typescript` was not correctly resolving the full types for Sentry.
1 parent 273e5e4 commit 28da802

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/nextjs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"exports": {
1616
"./package.json": "./package.json",
1717
".": {
18+
"types": "./build/types/index.types.d.ts",
1819
"edge": {
1920
"import": "./build/esm/edge/index.js",
2021
"require": "./build/cjs/edge/index.js",
@@ -40,8 +41,7 @@
4041
"require": "./build/cjs/index.client.js"
4142
},
4243
"node": "./build/cjs/index.server.js",
43-
"import": "./build/esm/index.server.js",
44-
"types": "./build/types/index.types.d.ts"
44+
"import": "./build/esm/index.server.js"
4545
},
4646
"./import": {
4747
"import": {

0 commit comments

Comments
 (0)