我最近安装了 Nextjs v12。我创建了一些 Api 路由(例如“/api/products”)。这些路由工作正常,但是当我 make concurrentFeatures: truein时next.config.ts,Api 路由不起作用。控制台中显示的错误是error - Error: Cannot find module for page: /api/products
这是我的next.config.ts文件内容:
module.exports = {
reactStrictMode: true,
experimental: {
concurrentFeatures: true
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的目录:
pages
----api
--------products
------------index.ts
Run Code Online (Sandbox Code Playgroud)