Skip to content

Commit

Permalink
change to named exports
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Feb 15, 2024
1 parent 7c007a2 commit a9f8b34
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions code/lib/core-events/src/errors/server-errors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chalk from 'chalk';
import { bold, gray, grey, white, yellow } from 'chalk';
import dedent from 'ts-dedent';
import { StorybookError } from './storybook-error';

Expand Down Expand Up @@ -417,21 +417,19 @@ export class MainFileESMOnlyImportError extends StorybookError {
];
if (this.data.line) {
message.push(
chalk.white(
`In your ${chalk.yellow(
this.data.location
)} file, this line threw an error: ${chalk.bold.cyan(
white(
`In your ${yellow(this.data.location)} file, this line threw an error: ${bold.cyan(
this.data.num
)}, which looks like this:`
),
chalk.grey(this.data.line)
grey(this.data.line)
);
}

message.push(
'',
chalk.white(`Convert the dynamic import to an dynamic import where they are used.`),
chalk.white(`Example:`) + ' ' + chalk.gray(`await import(<your ESM only module>);`)
white(`Convert the dynamic import to an dynamic import where they are used.`),
white(`Example:`) + ' ' + gray(`await import(<your ESM only module>);`)
);

return message.join('\n');
Expand Down

0 comments on commit a9f8b34

Please sign in to comment.