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.
9 of 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
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.