aws-mobile-appsync-sdk-js icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-js copied to clipboard

Module not found: Can't resolve 'redux-persist/constants'

Open jeznag opened this issue 6 years ago • 26 comments

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",

jeznag avatar May 19 '19 08:05 jeznag

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");

c-ancia avatar May 27 '19 11:05 c-ancia

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.

OlivierPT avatar Jun 08 '19 05:06 OlivierPT

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!

c-ancia avatar Jun 08 '19 09:06 c-ancia

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!

OlivierPT avatar Jun 08 '19 09:06 OlivierPT

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...

c-ancia avatar Jun 09 '19 18:06 c-ancia

Apologies for the delayed response, I made a comment on that PR.

Related: https://github.com/rt2zz/redux-action-buffer/issues/19

jordanranz avatar Jun 14 '19 22:06 jordanranz

Is this issue fixed by aws appsync team??

wangxpert avatar Jun 19 '19 19:06 wangxpert

There is a PR to fix it that is still waiting for validation... :(

OlivierPT avatar Jun 19 '19 19:06 OlivierPT

It's taking too long. PR is made 2 weeks ago, I guess??

wangxpert avatar Jun 19 '19 19:06 wangxpert

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

jhleath avatar Jul 04 '19 13:07 jhleath

what about the fix for this ??? still waiting ??

Zbish avatar Nov 11 '19 09:11 Zbish

Bump. Is there any update on this?

davidfarinha avatar Dec 15 '19 17:12 davidfarinha

Getting same issue, waiting for solusion

sankar9659 avatar Dec 24 '19 13:12 sankar9659

Any news on this ?

Blind12 avatar Feb 06 '20 09:02 Blind12

Any updates?

RaulTsc avatar Jun 09 '20 11:06 RaulTsc

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?

OlivierPT avatar Jun 09 '20 11:06 OlivierPT

+1 , please update on the eta

raaone7 avatar Aug 20 '20 05:08 raaone7

This bug is still open!!

ghost avatar Jan 15 '21 17:01 ghost

Any news?

Danue1 avatar May 10 '21 17:05 Danue1

any update?

tzutalin avatar Jun 14 '21 16:06 tzutalin

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.

andidev avatar Sep 06 '21 09:09 andidev

Checking in to see if any updates have been made on this bug?

dperconti avatar Sep 12 '21 05:09 dperconti

The fix has been merged and will be included in the next release

jamesaucode avatar Sep 14 '21 20:09 jamesaucode

@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 avatar Sep 15 '21 10:09 andidev

@andidev absolutely! I will take a look at the issue you linked 😄

jamesaucode avatar Sep 15 '21 22:09 jamesaucode

When will the next release be available? It's been over a year.

KatyeStevens avatar Oct 19 '22 19:10 KatyeStevens