Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent error basePath config validation error messages #39215

Closed
1 task done
hood opened this issue Aug 1, 2022 · 2 comments
Closed
1 task done

Inconsistent error basePath config validation error messages #39215

hood opened this issue Aug 1, 2022 · 2 comments
Labels
bug Issue was opened via the bug report template.

Comments

@hood
Copy link

hood commented Aug 1, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

next info output:

    Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP PREEMPT Mon, 21 Mar 2022 22:59:40 +0000
    Binaries:
      Node: 18.5.0
      npm: 8.12.1
      Yarn: 1.22.19
      pnpm: N/A
    Relevant packages:
      next: 12.2.3
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0

warn  - Latest canary version not detected, detected: "12.2.3", newest: "12.2.4-canary.8".
        Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
        Read more - https://nextjs.org/docs/messages/opening-an-issue
Done in 1.26s.

What browser are you using? (if relevant)

N.A.

How are you deploying your application? (if relevant)

N.A.

Describe the Bug

Getting both

Error: Specified basePath /. basePath has to be either an empty string or a path prefix"
    at assignDefaults (/myapp/node_modules/next/dist/server/config.js:266:19)
    at Object.loadConfig [as default] (/myapp/node_modules/next/dist/server/config.js:97:16)
    at async NextServer.prepare (/myapp/node_modules/next/dist/server/next.js:115:24)
    at async /myapp/node_modules/next/dist/cli/next-dev.js:147:9
error Command failed with exit code 1.

and

warn  - Invalid next.config.js options detected: 
[
  {
    "instancePath": "/basePath",
    "schemaPath": "#/properties/basePath/minLength",
    "keyword": "minLength",
    "params": {
      "limit": 1
    },
    "message": "must NOT have fewer than 1 characters"
  }
] 
See more info here: https://nextjs.org/docs/messages/invalid-next-config

When providing an empty basePath (both "" and undefined) in my next.config.js.

Expected Behavior

Getting coherent error messages

Link to reproduction

To Reproduce

@hood hood added the bug Issue was opened via the bug report template. label Aug 1, 2022
@ijjk
Copy link
Member

ijjk commented Aug 1, 2022

Hi, this was fixed in #38998 which is available in v12.2.4-canary.8 of Next.js, please update and give it a try!

@ijjk ijjk closed this as completed Aug 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants