#Netlify build failing with Astro & Sanity

18 messages · Page 1 of 1 (latest)

willow ledge
#

I am trying to use Netlify to deploy my Astro & Sanity site.
I have followed the docs and added the required build settings, and the build deploys without error.

However, when accessing the site I receive an error.

 SyntaxError - Named export 'LIST_NEST_MODE_HTML' not found. The requested module '@portabletext/toolkit' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using: import pkg from '@portabletext/toolkit'; const { isPortableTextToolkitList, isPortableTextListItemBlock, isPortableTextToolkitSpan, isPortableTextBlock, isPortableTextToolkitTextNode, nestLists, LIST_NEST_MODE_HTML, buildMarksTree } = pkg;

Is there a netlify config I am missing?

odd sandalBOT
#
No-one around right now?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.

slate heron
#

does it build fine locally?

willow ledge
#

Yeah, no issues locally.
The build on netlify doesn't fail, but the error occurs when you try and access the built site

slate heron
#

do you depend on @portabletext/toolkit directly?

willow ledge
#

Not directly, but I suspect astro-portabletext could be referencing it

willow ledge
#

Tested with Vercel just to narrow it down a bit and also doesn't work there.
Building and deployment summary are both successful within Vercel but the site itself doesn't work

#

Lookedi nto the vercel logs, and it is throwing the same error as Netlify

slate heron
#

could you try with node?

willow ledge
#

What do you mean?

slate heron
#

with the node adapter

willow ledge
#

Added node adapter, ran npm run build then npm run preview same error as with Netlify and Vercel

slate heron
#

probably something to report to astro-portabletext's repo then

willow ledge
slate heron
#

did that work?

willow ledge
#

Not sure why my package-lock doesn't use the latest version though as theyve merged a fix

slate heron
#

is the integration the latest version?

willow ledge