component-driven / component-driven/cypress-axe

Dependencies cannot be statically extracted - error when using with Cypress component testing

Open
#122 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
641
Forks
90
Avg merge
6h 8m
Merged PRs (30d)
1

Description

I am trying to use this lib with the cypress/react lib for component testing.

When I import this lib to the Cypress/support/index.js I get the following error and components I attempt to mount fail to render with:

 fix Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

As soon as I remove the import (import 'cypress-axe') it goes away.

Am I doing something wrong?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the warning from Cypress/support/index.js by importing cypress-axe alongside the Cypress React component-testing setup. Trace how that import is bundled, then verify the component mount no longer fails and the static dependency warning is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, react, typescript
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.