From 0bd6dddfcf4b690f7c9d3382afc58bb3a45ce377 Mon Sep 17 00:00:00 2001 From: Dan Jutan Date: Thu, 6 Oct 2022 10:37:58 -0400 Subject: [PATCH] Docs: add yarn workaround to node integration docs (#4978) * Add yarn workaround to troubleshooting section * npm can also cause this error --- packages/integrations/node/README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/integrations/node/README.md b/packages/integrations/node/README.md index 10fbded95..7c95dd0ea 100644 --- a/packages/integrations/node/README.md +++ b/packages/integrations/node/README.md @@ -110,7 +110,27 @@ This adapter does not expose any configuration options. ## Troubleshooting -For help, check out the `#support` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help! +### SyntaxError: Named export 'compile' not found + +You may see this when running the entry script if it was built with npm or Yarn. This is a [known issue](https://github.com/withastro/astro/issues/4974) that will be fixed in a future release. As a workaround, add `"path-to-regexp"` to the `noExternal` array: + +```js title="astro.config.mjs" ins={8-12} +import { defineConfig } from 'astro/config'; + +import node from "@astrojs/node"; + +export default defineConfig({ + output: "server", + adapter: node(), + vite: { + ssr: { + noExternal: ["path-to-regexp"] + } + } +}); +``` + +For more help, check out the `#support` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help! You can also check our [Astro Integration Documentation][astro-integration] for more on integrations.