And the default template project does: next.config.mjsnext.config.mjs
import { withPayload } from "@payloadcms/next/withPayload";const nextConfig = { // Your Next.js config here};export default withPayload(nextConfig, { devBundleServerPackages: false });
import { withPayload } from "@payloadcms/next/withPayload";const nextConfig = { // Your Next.js config here};export default withPayload(nextConfig, { devBundleServerPackages: false });
Error:
Task dev next deverror: Uncaught (in promise) TypeError: Relative import path "@payloadcms/next/withPayload" not prefixed with / or ./ or ../ hint: If you want to use a JSR or npm package, try running `deno add npm:@payloadcms/next/withPayload` at file:///home/djkato/data/Code/backend/next.config.mjs:1:29 at async loadConfig (file://...dist/server/config.js:964:36) at async getStartServerInfo (file:///.../next/15.2.3/dist/server/lib/app-info-log.js:95:5) at async ServerImpl.<anonymous> (file:///.../next/15.2.3/dist/server/lib/start-server.js:232:41)
Task dev next deverror: Uncaught (in promise) TypeError: Relative import path "@payloadcms/next/withPayload" not prefixed with / or ./ or ../ hint: If you want to use a JSR or npm package, try running `deno add npm:@payloadcms/next/withPayload` at file:///home/djkato/data/Code/backend/next.config.mjs:1:29 at async loadConfig (file://...dist/server/config.js:964:36) at async getStartServerInfo (file:///.../next/15.2.3/dist/server/lib/app-info-log.js:95:5) at async ServerImpl.<anonymous> (file:///.../next/15.2.3/dist/server/lib/start-server.js:232:41)
I assume this is something to do with import/importMaps but I tried different combinations and it's failing still. How do I fix this?
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
D
Deno
Chat about Deno, a modern runtime for JavaScript and TypeScript.