Do you have to use Webpack with Sapper?

Following, with Rollup results in a nonfunctional site that 503’s

Steps to reproduce:

npx degit "sveltejs/sapper-template#rollup" my-app
cd my-app
npm install
npm install -g @xdn/cli
xdn init
xdn deploy

Build output:

Waiting for build to be initialized…
Package received
2020-09-22T17:43:53Z - info - -----------------------
2020-09-22T17:43:53Z - info - InitializeBuild job started
2020-09-22T17:43:53Z - info - Running job ‘initializeBuild’ on xdn-build-lambda v2.12.0
2020-09-22T17:43:53Z - info - > Provisioning environment
2020-09-22T17:44:08Z - info - > Environment provisioned
2020-09-22T17:44:10Z - info - InitializeBuild job succeeded
2020-09-22T17:44:29Z - info - -----------------------
2020-09-22T17:44:29Z - info - DeployBuild job started
2020-09-22T17:44:29Z - info - Running job ‘deployBuild’ on xdn-build-lambda v2.12.0
2020-09-22T17:44:30Z - info - > Deploying Serverless functions
2020-09-22T17:44:57Z - info - > Uploading static assets
2020-09-22T17:44:57Z - info - > Cloud deployments live at:
2020-09-22T17:44:57Z - info - -->
2020-09-22T17:44:57Z - info - > Deploying to environment
2020-09-22T17:45:05Z - info - > Environment deployed
2020-09-22T17:45:07Z - info - DeployBuild job succeeded

Server Log output:
13:56:11.436 ERROR: Could not connect to backend

There are a few manual edits your need to make to rollup.config.js to properly bundle the app for serverless. They are documented here:

There are also equivalent steps for webpack documented here:

the manual edits mentioned in the doc, result in the following

xdn run

Running MOOVWEB XDN in development mode with caching disabled
(node:2096) UnhandledPromiseRejectionWarning: ReferenceError: pkg is not defined
at Object. (/Users/howard.ross/Repos/sap-test/rollup.config.js:98:25)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.require.extensions…js (/Users/howard.ross/Repos/sap-test/node_modules/sapper/dist/create_manifest_data.js:4190:28)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Function. (/Users/howard.ross/Repos/sap-test/node_modules/sapper/dist/create_manifest_data.js:4196:28)
at ()
at fulfilled (/Users/howard.ross/Repos/sap-test/node_modules/sapper/dist/_commonjsHelpers.js:27:58)
(node:2096) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see (rejection id: 1)
(node:2096) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
:information_source: 「wdm」: Compiled successfully.
MOOVWEB XDN ready on
Could not connect to backend connect ECONNREFUSED

Can you share the repo?

Here’s the repo at this time:

Looks like you also need to make this change to the server config:

- external: Object.keys(pkg.dependencies).concat(require('module').builtinModules),
+ external: require('module').builtinModules,

I will update the guides.