Troubleshoot common issues
Quick answers to the problems reported most often by real users, from the missing Vue template box to site-wide JSON:API 403 failures.
This page covers the issues that account for most of the confusion reported by real users over the life of this project. Each entry is a quick answer, with a link wherever a fuller explanation exists.
21 issues
Install and build
The build fails reaching the backend (ECONNREFUSED, timeouts, 400s) The build machine can't reach baseUrl. Test it with curl from there.
nuxt build and nuxt generate fetch schemas and content from Drupal
from the machine running the build. A baseUrl that works in your
browser can still be unreachable from the build: localhost inside a
container is the container itself, a Docker hostname does not resolve
outside its network, and a backend behind basic auth or a VPN blocks the
build the same way. Confirm with curl <baseUrl>/jsonapi from the build
environment. CI setups should wait for the backend to answer before
starting the build. See Request
topology.
Build error: the pages directory is missing Create an empty pages/ directory.
Nuxt requires a pages/ directory even when Druxt's wildcard
router provides every route. Create it with a
placeholder: mkdir pages && touch pages/.gitkeep.
Enabling the module fails with an undefined function error A drupal/druxt 1.3.0 bug. Upgrade to 1.3.1.
Call to undefined function druxt_resources() happens on drupal/druxt
1.3.0 when the module is added to a site that already has JSON:API
enabled. The Extend form and drush pm:install load druxt.install
without druxt.module, where 1.3.0 keeps the resource list. Upgrade:
composer require drupal/druxt:^1.3.1
drush crComposer refuses to install drupal/druxt Allow the pre-release for that one package with a stability flag.
A stability error (minimum-stability) means a dependency's current
release is below your project's floor. Allow the pre-release for that
one package with a stability flag, as in
composer require drupal/jsonapi_views:^1.1@beta, rather than lowering
minimum-stability project-wide. See Prepare the Drupal
backend.
"This dependency was not found: druxt" after an npm install Druxt 0.25 needs axios 0.34.0 or later at the top level.
Druxt 0.25 needs axios 0.34.0 or later at the top level of your project.
If npm installs an older axios there for @nuxtjs/axios, the Druxt
packages can't share one copy of druxt. npm gives each package its own
copy, and the build can't find druxt.
Check the tree in the Nuxt project (nuxt/ in the quickstart):
npm ls axios druxtA healthy tree shows axios 0.34.0 or later at the top level, and one
druxt, with every other entry for it marked deduped. If axios is
older or missing, install it in the same folder:
npm install axios@^0.34.0On Yarn 1, check with yarn list --pattern "axios|druxt". On Yarn 2 or
later, use yarn why druxt and yarn why axios. yarn --version tells
you which you have. A healthy tree has one druxt version, and axios
0.34.0 or later for your project. Fix it with
yarn add axios@^0.34.0.
"require() of ES Module axios" crash on a fresh install Fixed in Druxt 0.25.0. On older releases, pin or transpile axios.
On Druxt 0.25.0 and later this is fixed: the module transpiles axios. It
needs axios 0.34.0 or later in your project, as
the entry above
explains. On earlier releases, Nuxt 2's webpack 4 resolves newer
axios releases through their ESM entry, which the server, built as
CommonJS, cannot load. Pin axios to a 0.x release (the compatibility
table lists the known pins), or transpile it in
nuxt.config.js:
export default {
build: {
transpile: ['axios'],
},
};"error:0308010C:digital envelope routines" on Node 17 or later Build on Node 16, or turn on the OpenSSL legacy provider.
Node 17 moved to OpenSSL 3, which rejects the legacy hashing algorithms Nuxt 2's webpack 4 relies on. Either build on Node 16, or enable the legacy provider in the build environment:
NODE_OPTIONS=--openssl-legacy-provider nuxt buildThis also works in CI and static-host build settings by prefixing the build command; Deploy a static site covers pinning the host's Node version so this stays predictable.
Builds fail on Windows Use WSL2.
The build fails after installing Druxt by hand Nuxt 2 needs webpack 4.
Nuxt 2 needs webpack 4. If npm installs webpack 5 in your project, add it at the version Nuxt expects:
npm install --save-dev webpack@^4.47.0
Drupal backend
Every JSON:API request 403s, even for content that should be public Grant the Access DruxtJS JSON:API resources permission.
Druxt gates all of its JSON:API access behind one Drupal permission:
access druxt resources. Without it, requests can fail in ways that
don't obviously point at that permission. Errors instead reference whatever
the underlying JSON:API resource would normally require (e.g. entity
display-related admin permissions) rather than the Druxt permission itself.
If JSON:API access fails site-wide right after installing the Drupal Druxt module,
check Drupal → People → Permissions for Access DruxtJS JSON:API
resources (machine name access druxt resources)
before debugging anything else. The quickstart
grants this automatically. Installing Druxt on an existing site does not.
See the druxt module reference for the
full installation steps.
"…has been blocked by CORS policy" in the browser console Configure CORS in Drupal, or proxy the API through Nuxt.
The browser is refusing a cross-origin request to Drupal. Only requests
made by the browser can fail this way, so a site that server-renders
fine and breaks on navigation or live data is failing here. Two fixes, pick
one: configure CORS in Drupal so the backend
answers cross-origin requests, or proxy the API through the
frontend so no request is cross-origin (server deployments
only). druxt-menu releases before 0.22.0 sent <DruxtMenu>'s browser
requests straight to Drupal even with the proxy on, so a proxied site
could still fail here on its menu. Request
topology explains when each applies.
Writes fail while reads work, on druxt before 1.3.0 drupal/druxt before 1.3.0 allows no CORS methods. Upgrade to 1.3.1.
drupal/druxt releases before 1.3.0 enabled CORS but left
allowedMethods empty, which matches no method. Reads pass without a
preflight. A JSON:API write, or any request with an Authorization
header, is preflighted and fails. Upgrade, then rebuild the cache so
Drupal rebuilds its service container:
composer require drupal/druxt:^1.3.1
drush cache:rebuildOr configure allowedMethods yourself, as Configure CORS in
Drupal recommends. A site that already did was
never affected.
Routes and Views paths stop resolving after a composer update drupal/druxt 1.2.1 and earlier break on Decoupled Router 2.0.7. Upgrade.
composer update brings Decoupled Router 2.0.7, and drupal/druxt 1.2.1
and earlier fatal against it: their path translator overrides
onPathTranslation() without the : void return type 2.0.7 declares.
The symptom is quiet rather than loud. The fatal happens while the
container rebuilds, so Drupal keeps serving from the old container and the
visible effect is routes and Views paths silently not resolving, not an
error page. drush cr is usually where it first shows.
Fix by upgrading to the release that includes it:
composer require drupal/druxt:^1.3.1
drush cr1.2.2 has the fix and also ends Drupal 8 and 9 support, so this applies on core 10 or later. See #3618675.
The status report says a Druxt resource is missing Harmless on 1.3.0, and 1.3.1 stops the warning.
On 1.3.0 the report lists configurable_language as missing on a site
without the Language module, and jsonapi_resource_config without
JSON:API Extras. Nothing is broken, since the frontend never asks for a
resource the site does not have. 1.3.1 stops the warning.
Pages and routing
"Missing Vue template" box Expected in development: nothing themes that component yet. Expand it to create the file.
You're not seeing an error, this is expected. DruxtBlock and
DruxtField both show this box when nothing themes them yet (other modules
don't have it), and it only appears in development mode (nuxt dev).
Production builds show nothing there instead.
Expand the box: it lists every valid wrapper name for that component and has a Create button that scaffolds the file for you. See Theme Druxt components for the full explanation and how the wrapper-naming system works.
The site only shows "Welcome to Nuxt" Delete pages/index.vue so Drupal serves the homepage.
The Nuxt scaffolder creates a default pages/index.vue, and an explicit
page always wins over Druxt's wildcard route. Delete pages/index.vue
and the homepage resolves through Drupal like every other path. See
Decoupled routing.
A page shows "not found", or the wrong content Ask Decoupled Router what the path resolves to.
Druxt asks the Decoupled Router module which entity or View each path
belongs to, at its /router/translate-path endpoint. Request the same
endpoint from the machine that runs your Nuxt site. Replace
https://cms.example.com with your baseUrl, and /about with the
path that fails, language prefix included (such as /es/about):
curl 'https://cms.example.com/router/translate-path?path=/about'- It names the right
entityorview. Drupal is fine, so look at the Nuxt side: a file inpages/that wins over the wildcard route, as in the "Welcome to Nuxt" entry, or a server cache that hasn't cleared yet, as in Edited content stays stale. - It names the wrong entity. The alias is on more than one page, or it belongs to another language. Check them under Drupal → Configuration → Search and metadata → URL aliases.
- It answers 404, "Unable to resolve path". No page in Drupal has
that path. Check the URL alias on the page's edit form, and the
language prefix. If it started after a
composer update, see Routes and Views paths stop resolving. - It answers 403, "Access denied for entity". Drupal found the
page, but
curldoesn't send a login, so Drupal answers as it would an anonymous visitor. Check that the page is published. If only signed-in users should see it, the 403 is expected.
Stale or changed content
I changed a Drupal display and nothing happened on the frontend Schemas are built at startup. Restart, or turn on schema.refresh.
By default, schemas are generated once, at startup or at build. Content edits show
live; a rearranged display, a changed formatter or a new view mode waits
for a restart of nuxt dev or a rebuild. From druxt 0.25.0,
druxt.schema.refresh makes the Nuxt server regenerate a schema after
each cache clear, and on every request under nuxt dev:
// nuxt.config.js
export default {
druxt: {
schema: { refresh: true },
},
}A static site keeps the schemas from its build, unless its own Node server
serves the route with createSchemaRefresh. The schema
system
explains the timing.
Edited content stays stale on a server-rendered site The Nuxt server cache keeps it for max_age. Set up the clear endpoint.
From druxt 0.25.0 the Nuxt server keeps the JSON:API index and the menus
between requests, and with cache.content the entities, collections,
Views results and routes too, for as long as Drupal's page cache
max_age allows. An edit to any of them waits for that time to pass or
for a cache clear. Each Nuxt process has a cache of its own, and the cache is
off under nuxt dev, so the problem does not show there. Check max_age
under Drupal → Configuration → Development → Performance: at the
default of 0 nothing is kept and the cause is elsewhere. Then set up the
clear endpoint so Drupal empties the cache on a change, and clear each
process on a site that runs several: Cache Drupal responses on the Nuxt
server. In code, this.$store.dispatch('druxt/clearCache')
clears everything, schemas included.
A production site stops working after nuxt dev nuxt dev replaced the build. Build again and restart.
nuxt dev and nuxt build both write to .nuxt, so running the dev server replaces
the build a running nuxt start is serving. Run nuxt build again, then restart it.
Still stuck?
- Ask the docs. The docs MCP server, at
https://druxtjs.org/mcp, lets an AI assistant search and read these pages. MCP, the Model Context Protocol, is how AI assistants connect to outside tools. - Search the existing issues before you report. Each part of Druxt
has its own queue:
- Druxt, the Nuxt modules: github.com/druxt/druxt.js
- DruxtAuth, the login module: github.com/druxt/druxt-auth
- The Drupal Druxt module: drupal.org/project/issues/druxt
- JSON:API Views: drupal.org/project/issues/jsonapi_views
- Simple OAuth: drupal.org/project/issues/simple_oauth
- Decoupled Router and JSON:API Menu Items, on GitLab work items: decoupled_router and jsonapi_menu_items.
- Report a Druxt bug or ask for a feature with a new issue. Include the steps to reproduce and your Druxt, Nuxt, Node and Drupal versions.
- Fix it yourself. The druxt.js contributing guide explains how.