Skip to content

TypeError: require.resolveWeak is not a function (jest test) #19862

Closed
@Emiliano-Bucci

Description

Bug report

Describe the bug

There's an error when trying to test a component which contains a dynamic imported component. The error i get is TypeError: require.resolveWeak is not a function.

To Reproduce

  1. Clone the repo https://github.com/Emiliano-Bucci/jest-with-dynamic-import- (it's a fork of the repo with-jest example)
  2. Run tests

Expected behavior

It should be possible to test components which contains dynamic imported components, or dynamic components itself.

Screenshots

image

System information

  • OS: macOS 11.0.1
  • Browser: Chrome 87.0.4280.88
  • Version of Next.js: 10.0.3
  • Version of Node.js: 12.14.1
  • Deployment: Vercel

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

good first issueEasy to fix issues, good for newcomers

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions