You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have removed any sensitive information from my code snippets and submission.
Amplify Hosting feature
Environment variables
Is your feature request related to a problem? Please describe:
background
Nodejs has a feature to output logs with source map, showing the stacktrace of source code lines like:
Error [SomeError]: Request failed with status code 400
at async c (webpack://some/pre/compiled/source/code/file.ts:51:30)
at async l (webpack://some/pre/compiled/source/code/file.ts:122:19)
instead of showing the stacktrace of transpiled & minified source code lines like:
Error [SomeError]: Request failed with status code 400
at eP (.next/server/chunks/850.js:21:59036)
at async c (.next/server/chunks/847.js:1:13619)
The feature can be turned on if these conditions are met:
compile the source code with source map
For example, next.js can compile with source map with the following config:
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!
Before opening, please confirm:
Amplify Hosting feature
Environment variables
Is your feature request related to a problem? Please describe:
background
Nodejs has a feature to output logs with source map, showing the stacktrace of source code lines like:
instead of showing the stacktrace of transpiled & minified source code lines like:
The feature can be turned on if these conditions are met:
compile the source code with source map
For example, next.js can compile with source map with the following config:
ref: https://www.highlight.io/blog/lw5-next-js-server-sourcemaps
set NODE_OPTIONS=--enable-source-maps to launch nodejs
To use source map for server side logging, at this time, the
--enable-source-maps
is needed as the launch option of nodejs.https://nodejs.org/dist/latest-v22.x/docs/api/cli.html#cli_enable_source_maps
For example, the following next.js package.json can output logs with real source code lines:
problem
The amplify hosting service ignores the
NODE_OPTIONS
runtime environment.I did the following things:
adding
NODE_OPTIONS=--enable-source-maps
to the package.json file does not take effect. Amplify just ignores it.adding
NODE_OPTIONS=--enable-source-maps
to the.env.production while building the source does not take effect. Amplify just ignores it.Describe how you'd like this feature to work
I'd like to set (OR append) NODE_OPTIONS option for the amplify hosting runtime.
The feature might look like changing amplify.yml spec as:
But I'd appreciate if the feature is implemented in any kinds of ways.
The text was updated successfully, but these errors were encountered: