Files
cypress/packages/errors/index.js
Tim Griesser 92eac2f67e feat: Error standardization (#20323)
* refactor: reworking client-side error shape

* feat: add the CodeFrame to baseerror

* consolidate baseError handling, type fixes

* Fix UNIFY-1164 w/ test cleanup to avoid intercepting

* fix types, cleanup based on review / Brian

* fix: imports / types / tests

* cleanup tests, fix TSError location, add reinitializeCypress mutation

* fix: show correct stack trace file name (#20410)

* Improve comments for regexes / TSError capture

* feat: Add codeframe to error, address PR comments

* update snapshot

* change codeframe impl, per Brian's request

* Attempt to fix test flake

Co-authored-by: ElevateBart <ledouxb@gmail.com>
Co-authored-by: Alejandro Estrada <estrada9166@hotmail.com>
2022-03-02 18:03:52 -05:00

13 lines
566 B
JavaScript

// The errors package is always compiled in a production build, but when we're developing locally,
// there'a chance we can run into a situation where we're requriring the
// @packages/errors from the child process in a non-ts project, and we need to build this JIT.
// Otherwise the error will incorrectly be shown as "cannot find module ./src" instead of
// the actual error. Double check that we can require './src', and if not install ts-node
try {
require.resolve('./src')
} catch (e) {
require('@packages/ts/register')
}
module.exports = require('./src')