File tree Expand file tree Collapse file tree 5 files changed +373
-58
lines changed
packages/react-server-dom-esm Expand file tree Collapse file tree 5 files changed +373
-58
lines changed Original file line number Diff line number Diff line change 13
13
"prompts" : " ^2.4.2" ,
14
14
"react" : " experimental" ,
15
15
"react-dom" : " experimental" ,
16
- "undici" : " ^5.20.0"
16
+ "undici" : " ^5.20.0" ,
17
+ "webpack-sources" : " ^3.2.0"
17
18
},
18
19
"scripts" : {
19
20
"predev" : " cp -r ../../build/oss-experimental/* ./node_modules/" ,
20
21
"prestart" : " cp -r ../../build/oss-experimental/* ./node_modules/" ,
21
22
"dev" : " concurrently \" npm run dev:region\" \" npm run dev:global\" " ,
22
23
"dev:global" : " NODE_ENV=development BUILD_PATH=dist node server/global" ,
23
- "dev:region" : " NODE_ENV=development BUILD_PATH=dist nodemon --watch src --watch dist -- --experimental-loader ./loader/region.js --conditions=react-server server/region" ,
24
+ "dev:region" : " NODE_ENV=development BUILD_PATH=dist nodemon --watch src --watch dist -- --enable-source-maps -- experimental-loader ./loader/region.js --conditions=react-server server/region" ,
24
25
"start" : " concurrently \" npm run start:region\" \" npm run start:global\" " ,
25
26
"start:global" : " NODE_ENV=production node server/global" ,
26
27
"start:region" : " NODE_ENV=production node --experimental-loader ./loader/region.js --conditions=react-server server/region"
Original file line number Diff line number Diff line change @@ -141,13 +141,7 @@ if (process.env.NODE_ENV === 'development') {
141
141
142
142
const sourceMap = nodeModule . findSourceMap ( requestedFilePath ) ;
143
143
let map ;
144
- // There are two ways to return a source map depending on what we observe in error.stack.
145
- // A real app will have a similar choice to make for which strategy to pick.
146
- if ( ! sourceMap || Error . prepareStackTrace === undefined ) {
147
- // When --enable-source-maps is enabled, the error.stack that we use to track
148
- // stacks will have had the source map already applied so it's pointing to the
149
- // original source. We return a blank source map that just maps everything to
150
- // the original source in this case.
144
+ if ( ! sourceMap ) {
151
145
const sourceContent = await readFile ( requestedFilePath , 'utf8' ) ;
152
146
const lines = sourceContent . split ( '\n' ) . length ;
153
147
map = {
@@ -161,13 +155,6 @@ if (process.env.NODE_ENV === 'development') {
161
155
sourceRoot : '' ,
162
156
} ;
163
157
} else {
164
- // If something has overridden prepareStackTrace it is likely not getting the
165
- // natively applied source mapping to error.stack and so the line will point to
166
- // the compiled output similar to how a browser works.
167
- // E.g. ironically this can happen with the source-map-support library that is
168
- // auto-invoked by @babel/register if external source maps are generated.
169
- // In this case we just use the source map that the native source mapping would
170
- // have used.
171
158
map = sourceMap . payload ;
172
159
}
173
160
res . write ( JSON . stringify ( map ) ) ;
Original file line number Diff line number Diff line change @@ -755,6 +755,11 @@ vary@~1.1.2:
755
755
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
756
756
integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==
757
757
758
+ webpack-sources@^3.2.0 :
759
+ version "3.2.3"
760
+ resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
761
+ integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
762
+
758
763
wrap-ansi@^7.0.0 :
759
764
version "7.0.0"
760
765
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
Original file line number Diff line number Diff line change 58
58
"react-dom" : " ^19.0.0"
59
59
},
60
60
"dependencies" : {
61
- "acorn-loose" : " ^8.3.0"
61
+ "acorn-loose" : " ^8.3.0" ,
62
+ "webpack-sources" : " ^3.2.0"
62
63
}
63
64
}
You can’t perform that action at this time.
0 commit comments