Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions packages/react-scripts/backpack-addons/ssr/customWebpackUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,22 @@ function createCustomCompiler(

forkTsCheckerWebpackPlugin
.getCompilerHooks(compiler)
.receive.tap('afterTypeScriptCheck', (diagnostics, lints) => {
const allMsgs = [...diagnostics, ...lints];
.waiting.tap('awaitingTypeScriptCheck', () => {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plugin API changed, pulled this change from the upstream react-dev-utils example

console.log(
chalk.yellow(
'Files successfully emitted, waiting for typecheck results...'
)
);
});

forkTsCheckerWebpackPlugin
.getCompilerHooks(compiler)
.issues.tap('afterTypeScriptCheck', issues => {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

received -> issues

const format = message => `${message.file}\n${message}`;

tsMessagesResolver({
errors: allMsgs.filter(msg => msg.severity === 'error').map(format),
warnings: allMsgs
errors: issues.filter(msg => msg.severity === 'error').map(format),
warnings: issues
.filter(msg => msg.severity === 'warning')
.map(format),
});
Expand Down
8 changes: 8 additions & 0 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,14 @@ module.exports = function (webpackEnv) {
exclude: /@babel(?:\/|\\{1,2})runtime/,
test: /\.(js|mjs|cjs|jsx|ts|tsx|css)$/,
loader: require.resolve('source-map-loader'),
options: {
filterSourceMappingUrl: (url, resourcePath) => {
// We need to see warnings about incorrect sourcemaps only for local files or in debug mode
// Upstream issue in CRA, still not fixed
//https://stackoverflow.com/questions/63195843/webpack-module-warning-failed-to-parse-source-map-from-data-url
return !/.*\/node_modules\/.*/.test(resourcePath) || isDebugMode;
},
},
},
{
// "oneOf" will traverse all following loaders until one will
Expand Down
8 changes: 8 additions & 0 deletions packages/react-scripts/config/webpack.config.ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,14 @@ module.exports = function (webpackEnv) {
exclude: /@babel(?:\/|\\{1,2})runtime/,
test: /\.(js|mjs|cjs|jsx|ts|tsx|css)$/,
loader: require.resolve('source-map-loader'),
options: {
filterSourceMappingUrl: (url, resourcePath) => {
// We need to see warnings about incorrect sourcemaps only for local files or in debug mode
// Upstream issue in CRA, still not fixed
//https://stackoverflow.com/questions/63195843/webpack-module-warning-failed-to-parse-source-map-from-data-url
return !/.*\/node_modules\/.*/.test(resourcePath) || isDebugMode;
},
},
},
{
// "oneOf" will traverse all following loaders until one will
Expand Down