Having errors when trying to include static files and esbuild

Just ran a build,

logs: Netlify App

and the staging site: https://61f422a596a7cdfeeb617b5d--jolly-austin-b2157a.netlify.app

It may be entirely possible (dare I say likely…?) that I’m going about this the wrong way. The problem I’m actually trying to solve is getting netlify to include my static mdx files from my posts folder (repo: GitHub - nheingit/blog )

And the docs from what I could tell seems like adding this included_files = ["posts/**"] to my netlify config should have it included, and then that wasn’t working, so I somehow wound up in this rabbithole.

TLDR:

Trying to get this route: https://61f422a596a7cdfeeb617b5d--jolly-austin-b2157a.netlify.app/blog/test-mdx to work, much to my chagrin.

As far as I can see, the files are being included correctly:

image

But looking at the link of the route, the problem is because you’re building on macOS.

Netlify Functions run on Linux based containers. You’re trying to use ESbuild and they have a binary specific for each platform. When you build locally, CLI packages the locally installed binary and that is the macOS version in your case. But Lambda needs the Linux version.

So you need to either:

  1. Use CLI in a Linux environment.
  2. Let Netlify build your site in the CI.
1 Like