-
Notifications
You must be signed in to change notification settings - Fork 55
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
Module not found: Can't resolve 'ably' after upgrading to 2.0.3 #1751
Comments
Hi @Mosquid, thanks for your report. It’s hard to know what’s causing this from the information that you’ve provided. My first question is whether you followed the v2 migration guide? I ask because you mention that you upgraded from 1.2.49. The first step of the migration guide is to upgrade to 1.2.50 before performing the upgrade to v2. |
Hey. Here are the reproduction steps:
I'm using Node v18.16.0 and React 18.2.0 |
Hi @Mosquid ! After upgrading to ably-js v2 I only got expected errors, such as If you are still experiencing this problem, could you please share more information about your project setup that might affect dependency resolution (like your |
Hello @Mosquid ! I hope you're doing well. Were you able to resolve your issue with installing |
Hi @VeskeR,
|
I have run into this as well, but only when running Jest tests. I've got v2.0.2 installed. Ably is new to my project, however, so I didn't do any migration from 1.x. I get the same error message that @Mosquid gets. Even if I try to mock it, Jest seems to have no idea what ably is. This answer on Stack Overflow (although very old) mentions that the package the OP asked about had no |
+1 Same issue here with 2.0.4, never migrated and am suffering with my build step due to lack of |
@CurrrBell What version of the Jest are you using? It seems that Jest <28 was not able to resolve dependencies from @matthewcaminiti What does your environment look like in which you are trying to use |
Hey sorry forgot about this thread, got things resolved on my setup with the Webpack suggestion in the readme (using metro bundler in Expo React Native monorepo)! For context if still desired: |
Those fields were removed in de5ddfa and replaced with `exports` field we currently use. However, removal of root level entry fields from `package.json` have caused issues with importing `ably` in some setups: - React Native wasn't able to resolve `ably` at all, due to `exports` field resolution is not enabled by default yet [1] (we fixed this by re-adding root level `react-native` field in #1713) - older bundler versions do not support `exports` field, for example, webpack has added support for `exports` only in v5. - TypeScript added support for resolving `exports` field only in its 4.7 release [2] This commit re-adds root level entry fields so those setups will still be able to resolve `ably` package. Resolves #1751 [1] https://reactnative.dev/blog/2023/06/21/package-exports-support [2] https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-referencing
Those fields were removed in de5ddfa and replaced with `exports` field we currently use. However, removal of root level entry fields from `package.json` have caused issues with importing `ably` in some setups: - React Native wasn't able to resolve `ably` at all, due to `exports` field resolution is not enabled by default yet [1] (we fixed this by re-adding root level `react-native` field in #1713) - older bundler versions do not support `exports` field, for example, webpack has added support for `exports` only in v5. - TypeScript added support for resolving `exports` field only in its 4.7 release [2] This commit re-adds root level entry fields so those setups will still be able to resolve `ably` package. Resolves #1751 [1] https://reactnative.dev/blog/2023/06/21/package-exports-support [2] https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-referencing
Hi! |
I upgraded from 1.2.49 to 2.0.3 and the next time I started my react project, It gave me this error:
Module not found: Can't resolve 'ably' in '...'
┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: