Docs: add yarn workaround to node integration docs (#4978)

* Add yarn workaround to troubleshooting section

* npm can also cause this error
This commit is contained in:
Dan Jutan 2022-10-06 10:37:58 -04:00 committed by GitHub
parent 9683ae64ff
commit 0bd6dddfcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.