bigcommerce / stencil-cli

BigCommerce Stencil emulator for local theme development
https://developer.bigcommerce.com/stencil-docs
BSD 4-Clause "Original" or "Old" License
101 stars 141 forks source link

Stencil start - {"size":0,"timeout":0} - 401 unauthorized Can't access localhost after stencil start command - 401 #673

Open dobradovic opened 3 years ago

dobradovic commented 3 years ago

Hello, I can't access localhost after stencil start command, gives me back - {"size":0,"timeout":0} and in console GET http://localhost:3000/ 401 (Unauthorized).

I would point out that this worked and today I got this :)

Is there any chance that access token is changed or something like that?

Thanks on your time.

MaxGenash commented 3 years ago

Hello, @dobradovic. Make sure that normalStoreUrl is accessible and works normally (e.g. the store isn’t expired). If the store is accessible when visiting normalStoreUrl, but not accessible when visiting localhost - try creating a new accessToken. It shouldn’t expire, but just in case.

dobradovic commented 3 years ago

Hi @MaxGenash, my normalStoreUrl is accessible.

How can I create new accessToken any hint please, because Im new in this :)

Thanks for reply.

MaxGenash commented 3 years ago

@dobradovic https://support.bigcommerce.com/s/article/Store-API-Accounts

mattcoy-arcticleaf commented 3 years ago

This actually is an issue though. In older versions of Stencil, we got a nice "Unauthorized" page. However, we now just get this non-descript JSON error.

Stencil 2.1.1

unauthorized-2

Stencil 3.0.1

unauthorized-3
huntario commented 3 years ago

@dobradovic @mattcoy-arcticleaf Thanks for reaching out about this. Using Cornerstone 5.0 / Node 12.20.1 / Stencil CLI 3.0.3 I see the expected Unauthorized screen if I authorize the CLI with an invalid token.

Screen Shot 2021-01-14 at 11 52 09 AM

This seems to suggest the issue may be specific to the stores and/or themes in question. Was it a default version of a specific theme I could test out on my end? Let me know and I'll be happy to take a look. If we need to get into any store specifics, I'd recommend opening a support case https://support.bigcommerce.com/s/ > contact (upper right corner).

We definitely want to help anyway that we can with this, but we don't seem to replicate the issue with the default setup. I would recommend opening a support case so we can work through those store specifics.

mattcoy-arcticleaf commented 3 years ago

@huntario The specific theme I noticed this on was a slightly-customized Cornerstone 4.9.0.

However, I just tried again using Cornerstone 5.0 and Stencil CLI 3.0.3, and I'm still seeing the same result ({size: 0, timeout: 0}).

Anyway, it's not really a big issue since I know if I see the JSON error, I will need to check my .stencil credentials!