Open paperdave opened 11 months ago
Related: #6730
eslint
breaks because it is overriding the message
property, since it expects the error to extend Error
. But BuildMessage
and ResolveMessage
do not extend Error
.
We have to fix this properly @Jarred-Sumner, same issue as #9989
try {
const module = await import(
/* @vite-ignore */
path
);
if (!module.default) {
throw new Error(`Missing or invalid default export. Please export your Expressive Code config object as the default export.`);
}
return module.default;
} catch (error) {
const msg = error instanceof Error ? error.message : error;
// Since `error instanceof Error` is false, msg becomes `ResolveMessage`
const code = error.code;
if (code === "ERR_MODULE_NOT_FOUND" || code === "ERR_LOAD_URL") {
if (msg.match(/ec\.config\.mjs.*(imported from|resolved id)/))
// This line then fails with: `msg.match is not a function`
continue;
}
throw new Error(
`Your project includes an Expressive Code config file ("ec.config.mjs")
that could not be loaded due to ${code ? `the error ${code}` : "the following error"}: ${msg}`.replace(/\s+/g, " "),
error instanceof Error ? { cause: error } : void 0
);
}
Hi are we able to use Bun with Astro starlight?
Hi all, I am use it without any troubles.
You need just to add ec.config.mjs I am use this config:
` import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections' import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers'
/* @type {import('@astrojs/starlight/expressive-code').StarlightExpressiveCodeOptions} /
export default {
plugins: [
// Call the plugin initialization function inside the plugins
array
pluginCollapsibleSections(),
pluginLineNumbers(),
],
themes: ['material-theme-ocean', 'material-theme-palenight'],
}
`
Another thing its Cloudflare with bun adapter and SSR.
I cant configurate Pagefind..
What version of Bun is running?
No response
What platform is your computer?
No response
What steps can reproduce the bug?
Side effect of #7526 is we arent printing the error message
What is the expected behavior?
error with a stacktrace not undefined
What do you see instead?
No response
Additional information
No response