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

Use --enable-source-maps #761

Merged
merged 4 commits into from
Feb 10, 2022
Merged

Use --enable-source-maps #761

merged 4 commits into from
Feb 10, 2022

Conversation

72636c
Copy link
Member

@72636c 72636c commented Feb 9, 2022

We can get rid of the stack trace support in skuba-dive in favour of this Node.js CLI flag. This is stable in Node.js 14.18 which we require as of #760.

Closes #399.

We can get rid of the stack trace support in skuba-dive in favour of
this Node.js CLI flag. This is stable in Node.js 14.18 which we require
as of #760.

- https://github.com/seek-oss/skuba-dive#register
- https://nodejs.org/api/cli.html#cli_enable_source_maps

Closes #399.
@72636c 72636c requested a review from a team as a code owner February 9, 2022 12:06
@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2022

🦋 Changeset detected

Latest commit: c646cdd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
skuba Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

72636c added a commit to seek-oss/skuba-dive that referenced this pull request Feb 9, 2022
Node.js 14.18+ now supports this natively.

BREAKING CHANGE: `skuba-dive/register` no longer configures
`source-map-support` for your project. Upgrade to Node.js 14.18+ and use
the built-in `--enable-source-maps` option.

For a containerised application, update your Dockerfile:

```diff
- FROM gcr.io/distroless/nodejs:14 AS runtime
+ FROM gcr.io/distroless/nodejs:16 AS runtime

+ # https://nodejs.org/api/cli.html#cli_node_options_options
+ ENV NODE_OPTIONS --enable-source-maps
```

For a Serverless Lambda application, update your `serverless.yml`:

```diff
provider:
- runtime: nodejs12.x
+ runtime: nodejs14.x

functions:
  Worker:
    environment:
+     # https://nodejs.org/api/cli.html#cli_node_options_options
+     NODE_OPTIONS: --enable-source-maps
```

For a CDK Lambda application, update your stack:

```diff
new aws_lambda.Function(this, 'worker', {
- runtime: aws_lambda.Runtime.NODEJS_12_X,
+ runtime: aws_lambda.Runtime.NODEJS_14_X,
  environment: {
+   // https://nodejs.org/api/cli.html#cli_node_options_options
+   NODE_OPTIONS: '--enable-source-maps',
  },
});
```

See seek-oss/skuba#761 for more examples.
@72636c 72636c added this to the v4 milestone Feb 9, 2022
72636c added a commit to seek-oss/skuba-dive that referenced this pull request Feb 9, 2022
Node.js 14.18+ now supports this natively.

BREAKING CHANGE: `skuba-dive/register` no longer configures
`source-map-support` for your project. Upgrade to Node.js 14.18+ and use
the built-in `--enable-source-maps` option.

For a containerised application, update your Dockerfile:

```diff
- FROM gcr.io/distroless/nodejs:14 AS runtime
+ FROM gcr.io/distroless/nodejs:16 AS runtime

+ # https://nodejs.org/api/cli.html#cli_node_options_options
+ ENV NODE_OPTIONS --enable-source-maps
```

For a Serverless Lambda application, update your `serverless.yml`:

```diff
provider:
- runtime: nodejs12.x
+ runtime: nodejs14.x

functions:
  Worker:
    environment:
+     # https://nodejs.org/api/cli.html#cli_node_options_options
+     NODE_OPTIONS: --enable-source-maps
```

For a CDK Lambda application, update your stack:

```diff
new aws_lambda.Function(this, 'worker', {
- runtime: aws_lambda.Runtime.NODEJS_12_X,
+ runtime: aws_lambda.Runtime.NODEJS_14_X,
  environment: {
+   // https://nodejs.org/api/cli.html#cli_node_options_options
+   NODE_OPTIONS: '--enable-source-maps',
  },
});
```

See seek-oss/skuba#761 for more examples.
@72636c 72636c merged commit 81d8473 into master Feb 10, 2022
@72636c 72636c deleted the enable-source-maps branch February 10, 2022 03:33
@github-actions github-actions bot mentioned this pull request Feb 10, 2022
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

Successfully merging this pull request may close these issues.

Switch to Node.js --enable-source-maps
2 participants