Skip to content

Commit d424408

Browse files
committed
Fix TSC compiler crashed: Debug Failure. False expression. error
Error occurred any time a TSX file was edited. Related to microsoft/TypeScript#60692. TypeScript doesn't like exports of globals, even in JS files it shouldn't be checking anyway.
1 parent 44c8561 commit d424408

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎.storybook/stubs/drupal.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import "./drupalSettings";
1+
import './drupalSettings';
22

33
// Simple Drupal.behaviors usage for Storybook
44
// via https://github.com/emulsify-ds/emulsify-drupal/
55

6-
window.Drupal = { behaviors: {} };
6+
const Drupal = { behaviors: {} };
77

88
(function (Drupal, drupalSettings) {
9-
Drupal.throwError = (error) => {
9+
Drupal.throwError = error => {
1010
setTimeout(function () {
1111
throw error;
1212
}, 0);
@@ -39,4 +39,5 @@ window.Drupal = { behaviors: {} };
3939
};
4040
})(Drupal, window.drupalSettings);
4141

42+
window.Drupal = Drupal;
4243
export default Drupal;

‎.storybook/stubs/drupalSettings.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
window.drupalSettings = {};
1+
const drupalSettings = {};
2+
window.drupalSettings = drupalSettings;
23

3-
export default window.drupalSettings;
4+
export default drupalSettings;

0 commit comments

Comments
 (0)