next.js
a6006239 - fix: server actions entrypoint erroring with `type: commonjs` (#101164)

Commit
7 days ago
fix: server actions entrypoint erroring with `type: commonjs` (#101164) Fixes part of #99152. With `"type": "commonjs"` in package.json, adding a server action in the app would result in this build error: ``` ./.next-internal/server/app/page/actions.js Error: Specified module format (CommonJs) is not matching the module format of the source code (EcmaScript Modules) ``` This is fixed by making the virtual module be `.mjs` instead of `.js`, which allows for ESM syntax regardless of `package.json`.
Author
Parents
Loading