Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Errors on trying to use inside nuxt-i18n repo #53

Open
rchl opened this issue Aug 27, 2019 · 8 comments
Open

Errors on trying to use inside nuxt-i18n repo #53

rchl opened this issue Aug 27, 2019 · 8 comments

Comments

@rchl
Copy link

rchl commented Aug 27, 2019

  1. git clone git@github.com:nuxt-community/nuxt-i18n.git
  2. cd nuxt-i18n
  3. yarn add -D @nuxt/press (nuxt is already installed)
  4. Modify docs:build script in package.json to run nuxt generate
  5. 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)
@rchl rchl changed the title Errors on tring to use inside nuxt-i18n repo Errors on trying to use inside nuxt-i18n repo Aug 27, 2019
@rchl
Copy link
Author

rchl commented Aug 27, 2019

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": []
  }
}

@pimlie
Copy link
Collaborator

pimlie commented Aug 27, 2019

The warning WARN locale '' not supported, falling back to en originates from the search indexer of nuxt-community/lunr-module

@pimlie
Copy link
Collaborator

pimlie commented Aug 27, 2019

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 :)

@rchl
Copy link
Author

rchl commented Aug 27, 2019

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).

@pimlie
Copy link
Collaborator

pimlie commented Aug 27, 2019

I think this is fixed by 7e4580a, at least I c an succesfully run the docs with config files in the repo root.

@rchl
Copy link
Author

rchl commented Aug 27, 2019

That seems to work.
With prefix option set, navigating to root path (http://localhost:3000/) throws ugly error but that's probably different bug.

@pimlie
Copy link
Collaborator

pimlie commented Aug 27, 2019

Dont be like that, show me the error/bug! ;)

@rchl
Copy link
Author

rchl commented Aug 27, 2019

Since bugfix is not released yet I had to do crazy stuff to test but:

yarn add -D git+ssh://git@github.com:nuxt/press#develop
cd node_modules/@nuxt/press
yarn && yarn dist
cd -
yarn docs:dev

NuxtServerError: Cannot find module './'

Screenshot 2019-08-27 at 12 12 06

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants