stencil-cli icon indicating copy to clipboard operation
stencil-cli copied to clipboard

Stencil CLI crashes with "Debug: internal, implementation, error" very frequently

Open Laban1 opened this issue 3 years ago • 7 comments

Expected behavior

No crashes.

Actual behavior

Very frequent crashes of stencil-cli (=every few minutes, making productive development impossible). Running "stencil start" again repeatedly (2-5 times) can get it working again for a few minutes.

Upcoming request get: https://store-tp5<snip>2505.mybigcommerce.com/cart.php
Debug: internal, implementation, error
    TypeError: Cannot read property 'settings' of undefined
    at Object.internals.getPencilResponse (/root/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/server/plugins/renderer/renderer.module.js:404:29)
    at Object.internals.parseResponse (/root/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/server/plugins/renderer/renderer.module.js:263:22)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async internals.implementation (/root/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/server/plugins/renderer/renderer.module.js:49:20)
    at async module.exports.internals.Manager.execute (/root/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/toolkit.js:45:28)
    at async Object.internals.handler (/root/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/handler.js:46:20)
    at async exports.execute (/root/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/handler.js:31:20)
    at async Request._lifecycle (/root/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/request.js:312:32)
    at async Request._execute (/root/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/request.js:221:9)

Steps to reproduce behavior

stencil start Then just try to browse the site, e.g. : http://10.210.1.10:3000

Environment

stencil version: 5.2.5 node version: 14.20.0 npm version: 6.14.17

The BC store is multi-storefront enabled.

OS: Ubuntu 18.04.6 LTS (I have also tried on Windows 10 Pro, same issue). Hardware (if relevant): Dell XPS 8940 (11 Gen Intel i7-11700 @ 2.50 GHz), 32 GB RAM

Note: I never had this issue before I upgraded to Stencil CLI 5.2.5. I had a pretty recent version before this upgrade, but that version started having different crash issue, which is why I upgraded to the latest version. If I need to downgrade, please provide recommended stable version.

Laban1 avatar Oct 24 '22 23:10 Laban1

I have been experiencing the same issue as mentioned. Notably when making valid changes to config.json. I was not having issues with the current environment until the last couple of days.

My terminal errors coincide with a 500 server error displayed in browser, otherwise simply displayed as a "loaded" blank page.

Page either needs to be refreshed or stencil start multiple times as mentioned in OP until the site is displayed as expected.

MacOS 12.6 Firefox: 106.0.1 node -v: 14.20.17 npm -v: 6.14.17 stencil -V: 5.2.4 Stencil Theme: Peak (Light)

Terminal

Debug: internal, implementation, error 
    TypeError: Cannot read property 'settings' of undefined
    at Object.internals.getPencilResponse (/Users/kieran/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/server/plugins/renderer/renderer.module.js:400:29)
    at Object.internals.parseResponse (/Users/kieran/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/server/plugins/renderer/renderer.module.js:259:22)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async internals.implementation (/Users/kieran/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/server/plugins/renderer/renderer.module.js:49:20)
    at async module.exports.internals.Manager.execute (/Users/kieran/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/toolkit.js:45:28)
    at async Object.internals.handler (/Users/kieran/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/handler.js:46:20)
    at async exports.execute (/Users/kieran/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/handler.js:31:20)
    at async Request._lifecycle (/Users/kieran/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/request.js:312:32)
    at async Request._execute (/Users/kieran/.nvm/versions/node/v14.20.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/@hapi/hapi/lib/request.js:221:9)

Browser - Raw

{
  "statusCode": 500,
  "error": "Internal Server Error",
  "message": "An internal server error occurred"
}

king-puddles avatar Oct 25 '22 00:10 king-puddles

Just an update: yesterday I often had to try multiple times before a page even would load, but today the pages simply no longer load. I can see each request in the stencil window and there are no errors, just a blank browser page.

Stencil: image

Browser: image

I am using Chrome incognito and I have cleared the browser cache more than once.

I am not sure if this is related to the crashes, or if it is a separate issue, but wanted to provide the data (I have not seen this behavior before either).

I also tried the stencil against another client and it appears to work as it should there (based on a fairly brief test). A couple of things that are different with the client / site where I am seeing this issue are:

  • It is an MSF enabled client
  • We have a custom page defined in config.stencil.json (though this config is not persisted for some reason, so whenever I download the stencil, it is back to default and the custom page has to be re-entered). I have tried both with default and with the custom page defined, it makes no difference.

This is completely blocking me from development for this client (a large and urgent project), so speedy help and resolution would be much appreciated.

Laban1 avatar Oct 25 '22 14:10 Laban1

Just an update: yesterday I often had to try multiple times before a page even would load, but today the pages simply no longer load. I can see each request in the stencil window and there are no errors, just a blank browser page.

Stencil: image

Browser: image

I am using Chrome incognito and I have cleared the browser cache more than once.

I am not sure if this is related to the crashes, or if it is a separate issue, but wanted to provide the data (I have not seen this behavior before either).

I also tried the stencil against another client and it appears to work as it should there (based on a fairly brief test). A couple of things that are different with the client / site where I am seeing this issue are:

  • It is an MSF enabled client
  • We have a custom page defined in config.stencil.json (though this config is not persisted for some reason, so whenever I download the stencil, it is back to default and the custom page has to be re-entered). I have tried both with default and with the custom page defined, it makes no difference.

This is completely blocking me from development for this client (a large and urgent project), so speedy help and resolution would be much appreciated.

I too am having the exact same issue on a Mac with same versions of everything, except Stencil @ 5.2.4

diztinct-glenn avatar Oct 25 '22 17:10 diztinct-glenn

For those of us having the same issues - are you able to load a specific page instead of just the home page? eg. "localhost:3000/category"

After some troubleshooting, it seems that I am able to load any specific page without a problem, it's just the home page wherein the problem occurs. With the theme I am developing I have made no changes to the home page template or anything in config that would affect the home page.

king-puddles avatar Oct 25 '22 22:10 king-puddles

All: I heard back from our BigCommerce rep about this and the issue should be handled now. I just tried it with the account that was not working before and it appears to be working fine now.

Laban1 avatar Oct 25 '22 23:10 Laban1

Same here. Glad to hear this

diztinct-glenn avatar Oct 26 '22 00:10 diztinct-glenn

Yep, looks like it's running as expected now at my end too - thanks for the update!

king-puddles avatar Oct 26 '22 00:10 king-puddles