Errors on trying to use inside nuxt-i18n repo
git clone [email protected]:nuxt-community/nuxt-i18n.gitcd nuxt-i18nyarn add -D @nuxt/press(nuxt is already installed)- Modify
docs:buildscript inpackage.jsonto runnuxt generate yarn docs:build
Getting this warning and error:
WARN locale '' not supported, falling back to en
and then:
FATAL Cannot find module '/Users/rrr/nuxt-i18n/dist/_press/sources/docs//' 08:01:54
Require stack:
- /Users/rrr/nuxt-i18n/node_modules/@nuxt/press/dist/nuxt-press.js
- /Users/rrr/nuxt-i18n/node_modules/@nuxt/core/dist/core.js
- /Users/rrr/nuxt-i18n/node_modules/@nuxt/cli/dist/cli-command.js
- /Users/rrr/nuxt-i18n/node_modules/@nuxt/cli/dist/cli.js
- /Users/rrr/nuxt-i18n/node_modules/nuxt/bin/nuxt.js
Error: Cannot find module 'dist/_press/sources/docs//'
Require stack:
- node_modules/@nuxt/press/dist/nuxt-press.js
- node_modules/@nuxt/core/dist/core.js
- node_modules/@nuxt/cli/dist/cli-command.js
- node_modules/@nuxt/cli/dist/cli.js
- node_modules/nuxt/bin/nuxt.js
at node_modules/@nuxt/press/dist/nuxt-press.js:85:90
at new Promise (<anonymous>)
at importModule (node_modules/@nuxt/press/dist/nuxt-press.js:85:31)
at ModuleContainer.generateRoutes (node_modules/@nuxt/press/dist/nuxt-press.js:1297:24)
at distCopied (node_modules/@nuxt/press/dist/nuxt-press.js:1829:57)
When running nuxt dev instead, there is no error on building (just the locale warning), but I don't seem to be able to access any page - both http://localhost:3000/, http://localhost:3000/seo or http://localhost:3000/docs/seo return "page not found".
Auto-generated nuxt.press.json looks like this:
{
"docs": {
"dir": "docs",
"prefix": "/docs/",
"title": "My Documentation",
"search": true,
"nav": []
}
}
The warning WARN locale '' not supported, falling back to en originates from the search indexer of nuxt-community/lunr-module
From which folder do you run nuxt dev? If you are in the root of your repo you should pass the docs root dir to nuxt like nuxt dev docs. The dir option of nuxt.press.json is relative to the nuxt rootDir, see eg https://github.com/nuxt/press/blob/develop/docs/nuxt.press.json
-- edit -- or actually relative to the nuxt srcDir to be correct, they just happen to be the same often :)
I'm running nuxt dev from root of the repo, and both nuxt.config.js and nuxt.press.json are also in the root (were created automatically there).
I think this is fixed by 7e4580a1e9ce818d3399308571bdde0dcc37cd2a, at least I c an succesfully run the docs with config files in the repo root.
That seems to work.
With prefix option set, navigating to root path (http://localhost:3000/) throws ugly error but that's probably different bug.
Dont be like that, show me the error/bug! ;)
Since bugfix is not released yet I had to do crazy stuff to test but:
yarn add -D git+ssh://[email protected]:nuxt/press#develop
cd node_modules/@nuxt/press
yarn && yarn dist
cd -
yarn docs:dev
NuxtServerError: Cannot find module './'