dherault / dherault/serverless-offline

Node formating colors missing after upgrading from version 8.8.1 to 9 or above

Open
#1,612 2 comments 3 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
5.3k
Forks
811
Avg merge
2d 4h
Merged PRs (30d)
3

Description

## Bug Report

Using node 16.x, `console.log({ hello : 1 })`
![image](https://user-images.githubusercontent.com/18052624/201804666-2d2d1bf3-9b05-4bd8-8d17-8510f69add89.png)

Using `serverless-offline@8` it worked the same way:
![image](https://user-images.githubusercontent.com/18052624/201804901-a6395165-cce0-4795-acc6-5d37cbd36d46.png)

Upgrading to `serverless-offline@8`, `serverless-offline@9`, or `serverless-offline@10`, or `serverless-offline@11`
![image](https://user-images.githubusercontent.com/18052624/201805080-8e89fcc4-922a-4502-8336-5482ffa1b610.png)

**Sample Code**

- file: serverless.yml

```yaml
service: my-service

plugins:
- serverless-offline

provider:
runtime: nodejs16.x
stage: dev

functions:
hello:
events:
- http:
method: get
path: hello
handler: handler.hello
```

- file: handler.js

```js
'use strict'

exports.hello = async function hello() {
console.log({ hello: 1 })
return { body: 'OK' statusCode: 200, }
}
```

**Environment**

- `serverless` version: 3.24.1
- `serverless-offline` version: 11.3.0
- `node.js` version: v16.18.0
- `OS`: Mac OS 13

**Possible Solution**

I believe `serverless-offline` is running in its own `child_process` and the colours are not appropriately passed ([like there](https://stackoverflow.com/a/14231570/6203954)).

I'll be happy to do a PR is someone can point me here `serverless-offline` is instantiated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.