Next.js Discord

Discord Forum

Server actions stops working after migration to nextjs v15

Answered
Korat posted this in #help-forum
Open in Discord
Avatar
KoratOP
Hi everyone. I updated my project to v15 via this command pnpx @next/codemod@canary upgrade latest. After this everyting works fine except server actions. When I try to execute server actions I gets this server error:
 ⨯ ..\..\..\..\src\server\web\sandbox\context.ts (347:30) @ context.fetch
 ⨯ fetch failed
  345 |       const __fetch = context.fetch
  346 |       context.fetch = async (input, init = {}) => {
> 347 |         const callingError = new Error('[internal]')
      |                              ^
  348 |         const assetResponse = await fetchInlineAsset({
  349 |           input,
  350 |           assets: options.edgeFunctionEntry.assets,


My next.config.js
import createMDX from "@next/mdx"
import remarkGfm from "remark-gfm"

/**
 * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
 * for Docker builds.
 */
await import("./src/env.js")

/** @type {import("next").NextConfig} */
const nextConfig = {
  pageExtensions: ["mdx", "ts", "tsx"],
  serverExternalPackages: ["@node-rs/argon2"],
}

const withMDX = createMDX({
  options: {
    remarkPlugins: [remarkGfm],
    rehypePlugins: [],
  },
})

export default withMDX(nextConfig)


Versions:
- next@15.0.2
- react@19.0.0-rc-02c0e824-20241028
Image
Answered by Korat
After removing middleware.ts from project it starts working
View full answer

1 Reply

Avatar
KoratOP
After removing middleware.ts from project it starts working
Answer