diff --git a/code/lib/core-events/manager-errors.js b/code/lib/core-events/manager-errors.js index 6a1ce1522c1b..f94cf725de3c 100644 --- a/code/lib/core-events/manager-errors.js +++ b/code/lib/core-events/manager-errors.js @@ -1,4 +1,6 @@ -// This is required for projects that require paths such as `@storybook/core-events/manager-errors` -// but in CJS, while not in ESM mode. Else an error like this will occur: +// This is required for compatibility in projects that don't support the exports map field (e.g. Jest 27), +// so when require paths such as `@storybook/core-events/manager-errors`, +// An error like this will occur: // ENOENT: no such file or directory, open '/xyz/node_modules/@storybook/core-events/manager-errors.js' +// https://github.com/storybookjs/storybook/pull/24038#issuecomment-1704684432 module.exports = require('./dist/errors/manager-errors'); diff --git a/code/lib/core-events/preview-errors.js b/code/lib/core-events/preview-errors.js index a98055ba796d..1a144b6c7e20 100644 --- a/code/lib/core-events/preview-errors.js +++ b/code/lib/core-events/preview-errors.js @@ -1,4 +1,6 @@ -// This is required for projects that require paths such as `@storybook/core-events/preview-errors` -// but in CJS, while not in ESM mode. Else an error like this will occur: +// This is required for compatibility in projects that don't support the exports map field (e.g. Jest 27), +// so when require paths such as `@storybook/core-events/preview-errors`, +// An error like this will occur: // ENOENT: no such file or directory, open '/xyz/node_modules/@storybook/core-events/preview-errors.js' +// https://github.com/storybookjs/storybook/pull/24038#issuecomment-1704684432 module.exports = require('./dist/errors/preview-errors'); diff --git a/code/lib/core-events/server-errors.js b/code/lib/core-events/server-errors.js index 5f4eb31a408c..6aa7a95fd223 100644 --- a/code/lib/core-events/server-errors.js +++ b/code/lib/core-events/server-errors.js @@ -1,4 +1,6 @@ -// This is required for projects that require paths such as `@storybook/core-events/server-errors` -// but in CJS, while not in ESM mode. Else an error like this will occur: +// This is required for compatibility in projects that don't support the exports map field (e.g. Jest 27), +// so when require paths such as `@storybook/core-events/server-errors`, +// An error like this will occur: // ENOENT: no such file or directory, open '/xyz/node_modules/@storybook/core-events/server-errors.js' +// https://github.com/storybookjs/storybook/pull/24038#issuecomment-1704684432 module.exports = require('./dist/errors/server-errors');