-
-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: panic when imported json file is empty (#8397)
* fix: panic when imported json file is empty * fix: panic when imported json file is empty
- Loading branch information
1 parent
bcde793
commit 82b19c4
Showing
6 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
3 changes: 3 additions & 0 deletions
3
packages/rspack-test-tools/tests/diagnosticsCases/module-parse-failed/empty-json/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import empty from './empty.json' | ||
|
||
empty; |
11 changes: 11 additions & 0 deletions
11
.../rspack-test-tools/tests/diagnosticsCases/module-parse-failed/empty-json/rspack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* @type {import('@rspack/core').RspackOptions} | ||
*/ | ||
module.exports = { | ||
context: __dirname, | ||
devtool: false, | ||
optimization: { | ||
concatenateModules: true, | ||
minimize: false | ||
} | ||
}; |
8 changes: 8 additions & 0 deletions
8
packages/rspack-test-tools/tests/diagnosticsCases/module-parse-failed/empty-json/stats.err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ERROR in ./empty.json | ||
× Module parse failed: | ||
╰─▶ × Json parsing error: Unexpected end of JSON | ||
╭──── | ||
╰──── | ||
|
||
help: | ||
You may need an appropriate loader to handle this file type. |
82b19c4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open
82b19c4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ran ecosystem CI: Open