Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: webpack import error #441

Merged
merged 7 commits into from
Sep 25, 2023

Conversation

spaenleh
Copy link
Member

Origin of the error

In #430 we specified the package as using ESM (with type: module in package.json).
Cypress uses webpack to transpile the test code and when using the query-client package it was looking for fully specified imports (needs the .js extension) as this is in the specs of ESM. But our code was not fully specifying the imports.

Fix:

To fix this issue we:

  • reverted to an explicit type: "commonjs" in package.json
  • removed microbundle-crl and instead simply build the project with tsc
  • changes the target to commonjs in tsconfig.json

Additional changes

We also fixed the following:

  • deleted the example project
  • migrated to react-18 and the corresponding required changes linked to @testing-library/react-hooks

@spaenleh spaenleh added bug 🪲 Something isn't working build Build and developer operations labels Sep 25, 2023
@spaenleh spaenleh requested a review from pyphilia September 25, 2023 08:52
@spaenleh spaenleh self-assigned this Sep 25, 2023
@spaenleh spaenleh linked an issue Sep 25, 2023 that may be closed by this pull request
Copy link
Contributor

@pyphilia pyphilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM 🙏

@@ -45,6 +45,7 @@ describe('Chat Mention Hooks', () => {
hook,
wrapper,
});
console.log(data?.toJS(), response.toJS());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove?

@spaenleh spaenleh merged commit 853338b into main Sep 25, 2023
@spaenleh spaenleh deleted the 438-using-the-latest-version-throws-in-cypress branch September 25, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working build Build and developer operations v1.8.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using the latest version throws in Cypress
2 participants