Files
cypress/packages/errors/index.js
Jim Hays 34c8b1f884 refactor: Spellcheck (#27964)
Co-authored-by: Matthew Schile <mschile@cypress.io>
2023-10-11 10:06:10 -04:00

13 lines
567 B
JavaScript

// The errors package is always compiled in a production build, but when we're developing locally,
// there's a chance we can run into a situation where we're requiring 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')