Does vercel support mjs files

Question

Hello, I recently updated an angular project, and due to its update, it now generates .mjs files instead of .js files

I had a servless function to start the angular application before, and it turn out that after I updated the configuration, I needed to change .js to .mjs for the servless function
I’m now getting 500 internal server error on vercel, but works pretty fine locally when starting the command node api/api.mjs

I saw in 2021 someone had the same question : Does Vercel support .mjs files? · vercel/vercel · Discussion #5864 · GitHub

So is there any news on it ?

Hey @mgremy. The .mjs extension should work now. There was even experimental support for it back in 2021! :smile:

Keep in mind that what works, and what doesn’t, will depend a great deal upon your project configuration. If you’re still having trouble with it, please share the details here so we can help you debug. :pray:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.