redux-persist-crosstab icon indicating copy to clipboard operation
redux-persist-crosstab copied to clipboard

[Failed to compile] Module not found: Can't resolve 'redux-persist/constants' in 'redux-persist-crosstab'

Open shermendev opened this issue 6 years ago • 3 comments

Hi, I keep getting this error:

Failed to compile.

./node_modules/redux-persist-crosstab/index.js
Module not found: Can't resolve 'redux-persist/constants' in 'node_modules\redux-persist-crosstab'

"redux-persist-crosstab": "^3.7.0"

Minimum code to reproduce:

import crosstabSync from 'redux-persist-crosstab'

crosstabSync()

shermendev avatar Dec 28 '18 19:12 shermendev

Just tested the 4.0 version, still getting an error "redux-persist-crosstab": "^4.0.0-0"

Failed to compile.

./node_modules/redux-persist-crosstab/index.js
SyntaxError: \node_modules\redux-persist-crosstab\index.js: Unexpected token (3:12)

  1 | // @flow
  2 | import { KEY_PREFIX, REHYDRATE } from 'redux-persist/lib/constants'
> 3 | import type { PersistConfig } from 'redux-persist/es/types'
    |             ^
  4 | import type { Store } from 'redux'
  5 |
  6 | type CrosstabConfig = {

shermendev avatar Dec 28 '18 19:12 shermendev

I also can't add this. Is there a solution to allow this to be used @rt2zz?

brandoncc avatar May 30 '19 17:05 brandoncc

Hello, I have the same problem here. I think index.js should be transpiled to use terms that nodejs understands such as 'exports' and 'require' instead of 'import'. My current ugly temporary solution was to copy the function to the index.js of my react app, then convert the syntax to js (because that's the syntax I am using for this app), and finally add the proper imports. 2 min work. Works great. I would prefer to use this package instead.

Max-Z80 avatar Jul 03 '19 07:07 Max-Z80