Closed MichaelGoberling closed 2 months ago
Describe the bug running aio app <command> --verbose sometimes results in the following error:
aio app <command> --verbose
TypeError: first argument must be a string or instance of Error
this is because errors caught by the BaseCommand dont always have stack traces (error.stack) https://github.com/adobe/aio-cli-plugin-app/blob/master/src/BaseCommand.js#L38
To Reproduce Steps to reproduce the behavior:
import { NonexistentFile } from './NonexistentFile'
aio app build --verbose
Expected behavior
Error: Failed to resolve './NonexistentFile' from './web-src/src/components/NonexistentFile.js'
(funny enough the expected behavior is what you see when you dont use the --verbose flag)
Potential solution
just check for the stack trace (flags.verbose && error.stack)
fwiw, stack is an optional field of Error https://stackoverflow.com/a/75109213/22265578
stack
Error
JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-2955
Describe the bug running
aio app <command> --verbose
sometimes results in the following error:this is because errors caught by the BaseCommand dont always have stack traces (error.stack) https://github.com/adobe/aio-cli-plugin-app/blob/master/src/BaseCommand.js#L38
To Reproduce Steps to reproduce the behavior:
import { NonexistentFile } from './NonexistentFile'
)aio app build --verbose
TypeError: first argument must be a string or instance of Error
Expected behavior
Error: Failed to resolve './NonexistentFile' from './web-src/src/components/NonexistentFile.js'
(funny enough the expected behavior is what you see when you dont use the --verbose flag)
Potential solution
just check for the stack trace (flags.verbose && error.stack)