aws-mobile-appsync-sdk-js
aws-mobile-appsync-sdk-js copied to clipboard
Module not found: Can't resolve 'redux-persist/constants'
Note: If your issue/feature-request/question is regarding the AWS AppSync service, please log it in the official AWS AppSync forum
Do you want to request a feature or report a bug? Bug
What is the current behavior?
./node_modules/aws-appsync/lib/store.js Module not found: Can't resolve 'redux-persist/constants' in '/Users/jeremynagel/dev/personal/recycling-hero/node_modules/aws-appsync/lib'
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
I installed the latest version of app-sync and am getting the above error.
import AWSAppSyncClient from 'aws-appsync';
import { APP_SYNC_REGION, APP_SYNC_URI, API_KEY } from './config';
export const client = new AWSAppSyncClient({
url: APP_SYNC_URI,
region: APP_SYNC_REGION,
auth: {
type: 'API_KEY',
apiKey: API_KEY,
},
disableOffline: true
});
// ...
<ApolloProvider client={client as any}>
<Rehydrated>
...
</Rehydrated>
</ApolloProvider>
What is the expected behavior?
No errors
Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?
"aws-appsync": "^1.8.0",
"aws-appsync-react": "^1.2.8",
Hi,
I just updated the 2 packages aswell and get the same error now.
If it can help you, I temporary fixed it by changing in aws-appsync/lib/store.js line 68 var constants_2 = require("redux-persist/constants"); by var constants_2 = require("redux-persist/lib/constants");
Hi,
I get exactly the same when I try to use localforage as offline storage. The local modification above fix the issue for me also.
Hi,
Yes it works, but just a little reminder that it's usually not best practice or a good idea to modify directly a dependency. I've wrote this down just in case and also hoping that maybe the maintainers would see it and add it to a future release!
Exactly! That's why I just did a pull request with the expected change. I hope they include it quickly. That's really a shame they are not more reactive on this lib!
Oh okay, that's great, I hadn't noticed the pull request ahah, my bad! :) And yes it is, especially that it's quite a popular lib...
Apologies for the delayed response, I made a comment on that PR.
Related: https://github.com/rt2zz/redux-action-buffer/issues/19
Is this issue fixed by aws appsync team??
There is a PR to fix it that is still waiting for validation... :(
It's taking too long. PR is made 2 weeks ago, I guess??
There is a workaround if you are impatient for the fix to be merged in, I used the npm install at version to get both v4 and v5 of redux-persist in my app:
npm install --save redux-persist5@npm:redux-persist
npm install --save redux-persist@4
Then, in your application, do like:
import { persistStore, persistReducer } from 'redux-persist5';
which lets the AWS framework continue to use the redux-persist moniker for v4 and import correctly
what about the fix for this ??? still waiting ??
Bump. Is there any update on this?
Getting same issue, waiting for solusion
Any news on this ?
Any updates?
Since AWS Team didn't reply in time, I didn't follow the topic (because I moved to other topics) and my PR, sorry. It's more than 1 year now so I hope the issue has been fixed directly in the newer versions... isn't it?
+1 , please update on the eta
This bug is still open!!
Any news?
any update?
Can someone from AWS at least please comment? AppSync is a paid service. Tell us why we should use it if you just keep ignoring bugs like this? Upgrading react native has been a hell last 2 years. This bug makes it even a worse hell.
How come libs maintained by regular people can be better maintained then libs from companies for paid services? This is starting to get ridiculous. Facebook does the same thing for react native except thats not a paid service of course.
Checking in to see if any updates have been made on this bug?
The fix has been merged and will be included in the next release
@jamesaucode superthanks! However there is actually another similar breaking dependency update needed. If you guys fix this too my hope for the future of development will come back 😂 There is a hack/workaround for that dependency issue but it involves switching to yarn and it does not work 100% of the times you run yarn install. So I am not sure how to tell all our developers to handle that project.
Its this issue https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/654
pretty please take a look at that too ❤️
@andidev absolutely! I will take a look at the issue you linked 😄
When will the next release be available? It's been over a year.