Cli: Build from root fails with 403, unable to determine public folder

Created on 17 Apr 2020  Β·  8Comments  Β·  Source: netlify/cli

- Do you want to request a _feature_ or report a _bug_?

Would like to report a bug

- What is the current behavior?

Shows forbidden (server responses with code 403) on main page(index.html on localhost:port) after running ntl dev on root dir.

- If the current behavior is a bug, please provide the steps to reproduce.

  1. specify publish dir in netlify.toml
  2. my folder structure was
    project root
    -- public/index.html
    -- netlify.toml
[build]
  publish = "public"
  1. run ntl dev on the root dir

  2. browse to http://localhost:8888 (or any other port dev server has provided)

  • weird thing is that it shows expected behavior when I cd into the publish folder and then run ntl dev

- What is the expected behavior?

Shows the content of index.html and not forbidden text

- Local Environment Information

────────────────────┐
Environment Info β”‚
β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

System:

  • OS: Windows 10 10.0.18362
  • CPU: (6) x64 Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz

Binaries:

  • Node: 12.13.1 - C:\Program Files\nodejs\node.EXE
  • npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD

Browsers:

  • Edge: 44.18362.449.0

netlify-cli/2.46.0 win32-x64 node-v12.13.1

Most helpful comment

@thorsten-stripe This has been fixed in the latest version. Can you please upgrade npm i -g netlify-cli@latest and let us know if the issue still persists.

All 8 comments

@RaeesBhatti I just updated to version 2.47 and still see this issue persist:
image

Previously I was running version 2.36 where it was working fine.

Steps to reproduce:

  1. clone https://github.com/stripe-samples/checkout-netlify-serverless
  2. Run ntl dev in project root
  3. See that it doesn't recognise the ntelify.toml file correctly.

cc @jlengstorf who has also seen this issue before: https://twitter.com/jlengstorf/status/1251205225777557504

This issue still remains, anything I'm missing here? [email protected]

@wooleah
@thorsten-stripe

I cloned the repo and found that, to get rid of that Forbidden message error, we need to add a dev block in netlify.toml file.

[email protected]

[build]
    functions="functions"
    publish = "build"

[dev]
    functions="functions"
    publish = "build"

Try changing your .toml file to the above and run netlify dev, it should work.

Thanks @aditya-67 that did the trick for me. It still is strange, because as far as I understand [dev] is used to override [build] but it shouldn't be required. Anyway, will include it going forward.

we’re still working on fixing this β€”Β we’re short on engineering hours right now, but this is on our radar

@thorsten-stripe This has been fixed in the latest version. Can you please upgrade npm i -g netlify-cli@latest and let us know if the issue still persists.

@thorsten-stripe @RaeesBhatti @jlengstorf I've tested it both on checkout-netlify-serverless repo and the original project I filed the issue with and it seems to work fine on both of them([email protected]). And it works without [dev]. Thank you so much for resolving this!

πŸŽ‰ just tested with netlify-cli/2.50.0 darwin-x64 node-v13.7.0 works as expected. Thank you!

Was this page helpful?
0 / 5 - 0 ratings