https://cypress.io logo
Use setupNodeEvents: require('dd-trace/ci/cypress/...
# i-need-help
s
Hi gurus, So I am trying to embed Cypress tests into our Datadog instance using [this](https://www.datadoghq.com/blog/datadog-ci-visibility/). Currently, in my
cypress.config.ts
I have this code snippet:
Copy code
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:
Copy code
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 }; > | }