next-drupal
next-drupal copied to clipboard
Issues with Umami demo guide
Hi, I'm back! ;)
This time, trying to run through https://next-drupal.org/guides/umami-demo.
Where I ultimately get stuck (which is weird, since that didn't happen with the quickstart guide) is:
% yarn dev
yarn run v1.22.17
$ next dev
/bin/sh: next: command not found
error Command failed with exit code 127.
What happened before that is:
% yarn install
yarn install v1.22.17
info No lockfile found.
[1/4] 🔍 Resolving packages...
warning react-highlight-words > [email protected]: New custom equality api does not play well with all equality helpers. Please use v5.x
[2/4] 🚚 Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version "^12.19.0 || ^14.15.0 || ^16.13.0". Got "17.2.0"
error Found incompatible module.
I found https://stackoverflow.com/questions/56617209/the-engine-node-is-incompatible-with-this-module which directed to add an argument to tell yarn to ignore engine versions when doing its check. But I'm wondering if it's better to either a) document the specific Node versions this works with in the pre-requisites of this page, or b) tell people to do this engine ignoring explicitly, if that's indeed the right solution.
Because of the above, I haven't gotten this far, but I'm also curious about:
NEXT_PUBLIC_DRUPAL_BASE_URL=http://drupal.test
NEXT_IMAGE_DOMAIN=drupal.test
A few instructions above that, the tutorial directs you to run drupal quick-start which puts the server on http://127.0.0.1:8888 so I'm pretty sure those instructions will fail, too. (Specific to DDEV maybe?)
Anyway, once again, happy to make a PR to improve the docs once I know what they should say. :D
Ok, figured out (I think) that this is because I was not using the LTS version of Node.js. Doing:
nvm install --lts
...got me a bit closer. (Now running 16.6.0, which next-auth seems to like better.)
Now the problem is:
% yarn dev
yarn run v1.22.11
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
warn - Invalid next.config.js options detected:
- The value at .i18n has an unexpected property, localePath, which is not in the list of allowed properties (defaultLocale, domains, localeDetection, locales).
- The value at .images.domains[0] must be a string but it was undefined.
See more info here: https://nextjs.org/docs/messages/invalid-next-config
Error: Specified images.domains should be an Array of strings received invalid values ().
See more info here: https://nextjs.org/docs/messages/invalid-images-config
at assignDefaults (/usr/local/var/www/next-example-umami/node_modules/next/dist/server/config.js:314:23)
at Object.loadConfig [as default] (/usr/local/var/www/next-example-umami/node_modules/next/dist/server/config.js:105:16)
at async NextServer.prepare (/usr/local/var/www/next-example-umami/node_modules/next/dist/server/next.js:115:24)
at async /usr/local/var/www/next-example-umami/node_modules/next/dist/cli/next-dev.js:147:9
error Command failed with exit code 1.
Looks like some env variables are missing or not configured. What's in your .env.local file?
The value at .i18n has an unexpected property, localePath, which is not in the list of allowed properties (defaultLocale, domains, localeDetection, locales).
This was a recent change in how next-i18next handles config validation. You can safely remove localPath from next-i18next.config.js.
https://github.com/chapter-three/next-example-umami/blob/9330daeefdf3fb5568491517a0af0318c06de89a/next-i18next.config.js#L9
Not sure if it is related but at one point I had to add something similar in my next config
module.exports = {
i18n,
images: {
domains: [process.env.NEXT_IMAGE_DOMAIN],
remotePatterns: [
{
protocol: 'https',
hostname: 'umami3.internal',
port: '443',
pathname: 'sites/default/files/**',
},
],
},
}