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

Port not used from custom gatsby-config.js file #1716

Open
glassdimlygr opened this issue Feb 17, 2022 · 0 comments
Open

Port not used from custom gatsby-config.js file #1716

glassdimlygr opened this issue Feb 17, 2022 · 0 comments

Comments

@glassdimlygr
Copy link

Bug Report

When I create custom gatsby-config.js with a port and p setting of 3001, docz still runs on 3000.

To Reproduce

  1. create-docz-app my-docz-app && cd my-docz-app
  2. yarn docz:dev
  3. make gatsby-config.js in root with cp .docz/gatsby-config.js ../
  4. replace 3000 with 3001

Expectation: docz runs on port 3001.

Reality: it runs on 3000.

I did some console logging and was able to see that the config is properly merged and the output config has 3001.

{
    final: '[{"resolve":"gatsby-theme-docz","options":{"themeConfig":{},"src":"./","gatsbyRoot":null,"themesDir":"src","mdxExtensions":[".md",".mdx"],"docgenConfig":{},"menu":[],"m
  dPlugins":[],"hastPlugins":[],"ignore":[],"typescript":false,"ts":false,"propsParser":true,"props-parser":true,"debug":false,"native":false,"openBrowser":null,"o":null,"open":nul
  l,"open-browser":null,"port":4838,"p":4838,"root":"/Users/<redacted>/www/<redacted>/.docz","base":"/","source":"./","gatsby-root":null,"files":"**/*.{md,markdown,mdx}","public":"/public
  ","dest":".docz/dist","d":".docz/dist","editBranch":"master","eb":"master","edit-branch":"master","config":"","title":"<redacted>","description":"My awesome app using
  docz","host":"localhost","separator":"-","paths":{"root":"/Users/<redacted>/www/<redacted>","templates":"/Users/<redacted>/www/<redacted>/node_modules/docz-core/dist/templates","docz":"/Users/
  <redacted>/www/<redacted>/.docz","cache":"/Users/<redacted>/www/<redacted>/.docz/.cache","app":"/Users/<redacted>/www/<redacted>/.docz/app","appPackageJson":"/Users/<redacted>/www/<redacted>/package.json","
  appTsConfig":"/Users/<redacted>/www/<redacted>/tsconfig.json","gatsbyConfig":"/Users/<redacted>/www/<redacted>/gatsby-config.js","gatsbyBrowser":"/Users/<redacted>/www/<redacted>/gatsby-browser.js","
  gatsbyNode":"/Users/<redacted>/www/<redacted>/gatsby-node.js","gatsbySSR":"/Users/<redacted>/www/<redacted>/gatsby-ssr.js","importsJs":"/Users/<redacted>/www/<redacted>/.docz/app/imports.js","rootJs"
  :"/Users/<redacted>/www/<redacted>/.docz/app/root.jsx","indexJs":"/Users/<redacted>/www/<redacted>/.docz/app/index.jsx","indexHtml":"/Users/<redacted>/www/<redacted>/.docz/app/index.html","db":"/User
  s/<redacted>/www/<redacted>/.docz/app/db.json"}}},{"resolve":"gatsby-theme-docz","options":{"themeConfig":{},"src":"./","gatsbyRoot":null,"themesDir":"src","mdxExtensions":[".md",".mdx"
  ],"docgenConfig":{},"menu":[],"mdPlugins":[],"hastPlugins":[],"ignore":[],"typescript":false,"ts":false,"propsParser":true,"props-parser":true,"debug":false,"native":false,"openB
  rowser":null,"o":null,"open":null,"open-browser":null,"root":"/Users/<redacted>/www/<redacted>/.docz","base":"/","source":"./","gatsby-root":null,"files":"**/*.{md,markdown,mdx}","publi
  c":"/public","dest":".docz/dist","d":".docz/dist","editBranch":"master","eb":"master","edit-branch":"master","config":"","title":"<redacted>","description":"My awesome app using
  docz","host":"localhost","port":3001,"p":3001,"separator":"-","paths":{"root":"/Users/<redacted>/www/<redacted>","templates":"/Users/<redacted>/www/<redacted>/node_modules/docz-core/dist/templ
  ates","docz":"/Users/<redacted>/www/<redacted>/.docz","cache":"/Users/<redacted>/www/<redacted>/.docz/.cache","app":"/Users/<redacted>/www/<redacted>/.docz/app","appPackageJson":"/Users/<redacted>/www/rat
  e.com/package.json","appTsConfig":"/Users/<redacted>/www/<redacted>/tsconfig.json","gatsbyConfig":"/Users/<redacted>/www/<redacted>/gatsby-config.js","gatsbyBrowser":"/Users/<redacted>/www/<redacted>
  /gatsby-browser.js","gatsbyNode":"/Users/<redacted>/www/<redacted>/gatsby-node.js","gatsbySSR":"/Users/<redacted>/www/<redacted>/gatsby-ssr.js","importsJs":"/Users/<redacted>/www/<redacted>/.docz/app
  /imports.js","rootJs":"/Users/<redacted>/www/<redacted>/.docz/app/root.jsx","indexJs":"/Users/<redacted>/www/<redacted>/.docz/app/index.jsx","indexHtml":"/Users/<redacted>/www/<redacted>/.docz/app/in
  dex.html","db":"/Users/<redacted>/www/<redacted>/.docz/app/db.json"}}}]'
  }
  • docz version: 2.4.0
  • OS: MacOS 10.15.7
  • Node/npm version: v14.18.2 npm 6.14.15

Workaround:

Specify port in package.json like so "docz:dev": "docz dev --port=3001",

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

No branches or pull requests

1 participant