---
schema_version: "1"
id: af18f416f3bbb4dd4e35512811e28fa68e71039f5c050cbbed0d213302c80420
title: Troubleshooting Guide
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwr-node/lwr/guides/resolve-errors.md
canonical_url: https://developer.salesforce.com/docs/platform/lwr/guide/resolve-errors.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 80b4dd28423bfbe8f243dea9ccb59a28d58f0417dba45110340a003c7b593580
products:
  - Lightning Web Runtime
---
# Troubleshooting Guide

Want to resolve an error thrown by Lightning Web Runtime (LWR) on Node.js or an LWR package? Find the error message on this page and follow the corresponding guidance.

The error messages are grouped by which LWR package they're related to. To quickly navigate to the error message you want, use the Table of Contents in the right sidebar or your browser's **Find** tool.

## General LWR Errors

**`Unable to load configurable module: ${filepath}`**

The error message returns all the modules that don't exist or fail to transpile.

Review your app's config file (`lwr.config.json`) and make sure that it sets only the following configurations as modules:

- `hooks`
- `route.routeHandler`
- `moduleProviders`
- `viewProviders`
- `viewTransformers`
- `assetProviders`
- `assetTransformers`
- `resourceProviders`

<!--
**`EADDRINUSE` - `HMR Socket Server: Port ${this.context.appConfig.port} already in use.`**

**`errorRoute` - `[view-middleware] Route Error ${req.originalUrl}`**

**`DiagnosticsError` - `LWR Diagnostic Error: err.message`**

**`[SSG] Error occurred processing asset config:`** -->

## @lwrjs/auth-middleware

**`${MESSAGE_PREFIX}could not authenticate. Error body:{text}`**

The middleware tried to [request an access token](https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_oauth_web_server_flow.htm) from the configured Salesforce connected app, but the OAuth endpoint returned an error.

To identify the source of the error, use the `Error body` text. For example, if the error message reports `OAuth not set up correctly`, you should review your OAuth settings for issues.

## @lwrjs/diagnostics

**`LwrConfigValidationError` - `Configuration validation errors in ${SOURCE_BY_PHASE[phase]}`**

This error message returns `"message"` text with specific information about where the issue is located in your code. To resolve this error, make sure your app config:

- Contains only valid JSON
- Contains only valid properties
- Matches the config interface

**`LwrUnresolvableError [DiagnosticsError]: 404: Could not find {item} at "{filepath}"`**

This package returns this error when a module, bundle, resource, asset, or view wasn't found for a given specifier.

Make sure the content you're referencing is configured properly, and ensure that the filepath printed in this error message points to the correct resource.

**`LwrServerError [DiagnosticsError]: An error occurred during warmup: {error text}`**

The server failed to load configured modules into the runtime cache during startup or warmup. Use the `error text` printed in this message to identify which module or modules failed to load and why.

Warmup only occurs when the `WARMUP` environment variable is set to `true`.

**`invalidMode` - `No configuration found for server mode - ${mode}`**

Your configured [server mode](https://developer.salesforce.com/docs/platform/lwr/guide/lwr-get-started.md#set-the-lwr-server-modes) has to be `dev`, `prod`, `compat`, or `prod-compat`. Check your server mode and ensure it's set to one of these values.

## @lwrjs/router

**`INVALID_MIXIN_CMP` - `{0} must be an Element type`**

LWR throws this error when you try to add NavigationMixin to an invalid resource. To correct this, add [NavigationMixin](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/navigationmixin.md) to specifically a Lightning web component.

**`MISSING_CONTEXT` - `Could not find context to perform navigation action.`**

To use the navigation actions [`navigate()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/navigate.md) and [`generateUrl()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/generateurl.md), you have to configure the `context` property. Set `context` to the stringified ID of the parent router container nearest to the component that's generating a URL.

The component that performs navigation actions has to be a descendant of a router (like [`<lwr-router-container>`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/lwr-router-container.html)) in the DOM. LWR throws this error when you set `context` to an invalid router container.

**`MULTIPLE_ROOTS` - `Router connection failed. There can only be one root router.`**

Router nodes like [`<lwr-router-container>`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/lwr-router-container.html) can be nested, but they can't be siblings in the DOM. Check your router node hierarchy to make sure it's valid.

**`MULTIPLE_CHILDREN` - `Could not add to the navigation hierarchy. There can only be one child per navigation node.`**

Router nodes can have a maximum of one child. Make sure each of your routers has one child or no children.

**`MISSING_ROUTE` - `A route cannot be created to navigate to URL "{0}"`**

The page reference or URL passed to [`navigate()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/navigate.html) or [`generateUrl()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/generateurl.html) is invalid. Use the URL from the error message to identify the resource that's triggering this error, then correct it.

**`MISSING_URL` - `A URL cannot be created to navigate to route "{0}"`**

The page reference or URL passed to [`navigate()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/navigate.html) or [`generateUrl()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/generateurl.html) is invalid. Use the URL from the error message to identify the resource that's triggering this error, then correct it.

**`PRENAV_FAILED` - `A preNavigate hook listener blocked routing to "{0}"`**

The `preNavigate` hook of the router blocked navigation to the given page reference or URL.

**`MISSING_ROUTE_TEMPLATE` - `A route definition must contain a "uri" property.`**

To configure routing for your app, you have to set the `uri` property for all of your route definitions. For more information about valid values for `uri`, see [`RouteDefinition`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/routedefinition.md) or [`LwrConfigRouteDefinition`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/lwrconfigroutedefinition.md).

**`INVALID_ROUTE_QUERY` - `Invalid query param in route definition.`**

The query in the `uri` property of a route definition is invalid. Review and correct your query. For more information about valid values for `uri`, see [`RouteDefinition`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/routedefinition.md) or [`LwrConfigRouteDefinition`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/lwrconfigroutedefinition.md).

**`MISSING_PAGE_BINDING` - `Route definition must provide page binding.`**

All route definitions configured for a router must have a `page` property. Review your route definitions to ensure that each one includes a `page`.

**`INVALID_PAGE_BINDING` - `Invalid page binding in route definition.`**

The `page` property of a route definition is invalid. For more information about valid values for `page`, see [`RouteDefinition`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/routedefinition.md) or [`LwrConfigRouteDefinition`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/lwrconfigroutedefinition.md).

**`INVALID_URI_SYNTAX` - `Invalid URI syntax. URI cannot contain *, +, (, ).`**

Remove any instances of `*`, `+`, `(`, and `)` from the URI that triggered this error.

**`VIEW_IMPORT_FAILED` - `Error importing view with name "{0}", failure was: {1}.`**

There was an error importing the module returned by the `update()` function of the route handler for the current route. This error message should include more specific information about the cause of the error.

**`VIEW_MISSING` - `Expected a view with name "{0}" in the viewset.`**

`RouteHandler.update()` tried to return a requested view, but the view is missing from the [`ViewSet`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/routedestination.html#viewset) returned by [`update()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/update.html).

To resolve this error, make sure your `ViewSet` object for your `RouteDestination` contains the desired [`ViewInfo`](hhttps://developer.salesforce.com/docs/platform/lwr/references/csr-reference/routedestination.html#viewinfo) object. For more information about these objects, see [`RouteDestination`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/routedestination.html).

**`VIEW_IMPORT_FAILED_WITH_SPECIFIER` - `Error importing module "{0}" from view with name "{1}", failure was: {2}.**

There was an error importing the module returned by the [`update()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/update.html) function of the route handler for the current route. This error message should include more specific information about the cause of the error.

**`NO_ROUTE_MATCH` - `A routing match cannot be found for {0}.`**

The page reference or URL passed to [`navigate()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/navigate.html) or [`generateUrl()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/generateurl.html) is invalid. Use the details in this error message to identify the input that's causing this error, and then correct it.

**`INVALID_ROUTE_HANDLER` - `Route definition "{0}" does not have a valid route handler module.`**

The route handler class for a route definition is invalid.

To resolve this issue, confirm that the route handler has a default export.

**`DESTINATION_NOT_FOUND` - `Route handler returned 404: Not Found.`**

The route handler [`update()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/update.html) function for the current route returned a `404` error.

**`DESTINATION_ERROR` - `Route handler returned error status {0}: {1}.`**

The route handler [`update()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/update.html) function for the current route returned a non-`404` error status.

**`NO_INIT_URL` - `Cannot initialize a server router without a "url".`**

A configuration without the required url property was passed to the `createServerRouter()` function. Define a URL for the server router.

## @lwrjs/lambda

**`unhandledRejection - Unhandled Rejection: {}`**

A promise threw an error during server execution. This error usually happens during server-side rendering.

If your component invokes an asynchronous task, make sure it doesn't attempt to execute non-portable APIs like `window` or `document`.

## @lwrjs/lwc-ssr

This section describes how to resolve errors caused by invalid server-side rendering (SSR) configurations. For information about setting up SSR for LWR apps, see [Server-Side Rendering](https://developer.salesforce.com/docs/platform/lwr/guide/lwr-ssr.md).

**`Adding links during server-side rendering failed. Could not find the </head> tag.`**

LWR can't add links returned by [`getServerData`](https://developer.salesforce.com/docs/platform/lwr/guide/lwr-enable-ssr-site.md#load-data-during-ssr) hooks to the page because it doesn't have a `<head>` tag. Add a `<head>` tag to the page's layout template.

**`Server-side rendering for "bad/cmp" failed. Falling back to client-side rendering. Reason: SSR Error`**

[`lwr.renderComponent()`](https://developer.salesforce.com/docs/platform/lwr/guide/lwr-enable-ssr-site.md#opt-in-to-ssr) failed for the given component specifier because the component isn't portable. Review the error message for more details about the source of the issue.

## @lwr/src

**`Node version ${nodeVersion} is not one of LWR Lambda's supported versions`**

Upgrade `node` to a supported version. For information about which versions of `node` are valid, check out [`lwr/package.json`](https://www.npmjs.com/package/lwr?activeTab=code) and review the `node` entry in the `engines` section.
