Closed devdany closed 3 years ago
@devdany I believe there is an undocumented backwards incompatibility between apollo client v2 and v3 within webpack and/or jest config that will cause this, due to some unknown bundling issues that have arisen since the v3 upgrade. I have attempted to document what I could in #7464.
I was able to fix this issue by not running my source code through either webpack's resolve
as well as not running it through jest's moduleDirectories
.
To clarify, this was my configuration before:
// webpack.config.js
resolve: {
modules: ['node_modules', 'client'],
}
// jest.config.js
moduleDirectories: ['node_modules', 'client'],
And I had to refactor my application and imports to support this config
// webpack.config.js
resolve: {
modules: ['node_modules'],
}
// jest.config.js
moduleDirectories: ['node_modules'],
Let us know if this is still a concern with @apollo/client@latest
- thanks!
I am trying mocking apollo provider for test (jest).
But, test is can not started because of error throwded in MockedProvider
What is the problem?