Nextjs xdn run succeeds deploy fails

With NextJS apps why does xdn run succeed but xdn deploy fails with

Error: Next.js is not properly configured for deployment on the Moovweb XDN. Please add the withXDN() plugin to next.config.js.

For example:

  const withXDN = require('@xdn/next/withXDN')

  module.exports = withXDN({
    // additional Next.js config options here
  })

Please update next.config.js file and try again. If that file does not exist, simply add the example above to the root directory of your app.

To resolve this follow the instructions here: https://developer.moovweb.com/guides/next#section_3__edit_

and add

// next.config.js

const { withXDN, withServiceWorker } = require('@xdn/next/config')

module.exports = withXDN(withServiceWorker())
1 Like

When trying to migrate from xdn to layer0, this ‘@xdn/next/withXDN’ becomes ‘@layer0/next/withXDN’,
but I keep getting the module not found error, any solutions ?

You also need to replace withXDN with withLayer0. We will update the migration guide to include this.

Will try that, thanks for the quick response