Closed d3v1an7 closed 1 month ago
This doesn't look right, the hmr.js
file isn't imported in the render
export. Are you perhaps importing other things too?
Btw Maizzle 5 isn't "pure" ESM, we still use and import some libraries that are CJS, not sure if that would affect Netlify in any way though.
Yeah, on a bit of a deeper dive, I reckon this is due to how Netlify bundles up 3rd party deps for serverless functions (it creates a single ~250000 line index.js file for each endpoint that contains evvvverything, and implements a custom require function, etc).
I'll close this and try spinning up Maizzle on another serverless provider instead!
My usage of Maizzle is a bit convoluted -- I'm using the Maizzle render API in a Netlify serverless function. I've switched Netlify to use ESM, but I think it's still compiling down to CJS or doing something weird.
In any case, when adding:
I get the error:
It's very likely that this is a more of an issue with Netlify, but I wanted to just double check as the error seems to be pointing at some code that handles server routes, which (on the surface!!) seems like I shouldn't need when just using
render
.