Skip to content

Commit

Permalink
Merge pull request #682 from Financial-Times/apaleslimghost-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost authored Nov 30, 2022
2 parents 4adb3de + 117bcf9 commit 74fc350
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/x-engine/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ const resolvePeer = require('./concerns/resolve-peer')
const formatConfig = require('./concerns/format-config')

// 1. try to load the application's package manifest
const pkg = require(resolvePkg())
const pkgPath = resolvePkg()
const pkg = require(pkgPath)

// 2. if we have the manifest then find the engine configuration
const raw = deepGet(pkg, 'x-dash.engine.server')

if (!raw) {
throw new Error(`x-engine requires a server runtime to be specified. none found in ${pkg.name}`)
throw new Error(`x-engine server configuration not found in ${pkg.name}'s package.json (${pkgPath}). this configuration is required so that x-engine knows which JSX runtime to use. follow the configuration guide to add this configuration: https://github.com/Financial-Times/x-dash/tree/main/packages/x-engine#configuration`)
}

// 3. format the configuration we've loaded
Expand Down

0 comments on commit 74fc350

Please sign in to comment.