straight-chef-47891
03/20/2023, 10:26 PMcypress.config.ts I have this code snippet:
typescript
const legacyConfig = require('./cypress/plugins/index');
e2e: {
setupNodeEvents(on, config) {
return legacyConfig(on, config); // since we still use the old plugin file to override configs
},
...
}
However, Datadog is asking to use something like this:
typescript
e2e: {
setupNodeEvents: require('dd-trace/ci/cypress/plugin'),
supportFile: 'cypress/plugins/index.ts',
...
}
When I use the one that Datadog suggests, I get this error:
> Error: Webpack Compilation Error
> ./node_modules/js-library-detector/library/libraries.js 1360:107
> Module parse failed: Unexpected token (1360:107)
> You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> | npm: 'nuxt',
> | test: function(win) {
> if (win.__NUXT__ || win.$nuxt || [...win.document.querySelectorAll('*')].some(el => el.__vue__?.nuxt)) {
> | return { version: UNKNOWN_VERSION };
> | }