lelandrichardson/redux-pack

module not found

stunaz opened this issue · 9 comments

How to import the middleware via nom ?
looks like there is an issue in your package.json file at

"main": "lib/index.js"

@stunaz can you show me the code you are trying to use to add the middleware?

I should put up an example in the readme for this... something like this should work:

import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import pack from 'redux-pack';

const middlewares = [
  thunk,
  pack.middleware,
];

const store = createStore(reducer, applyMiddleware(...middlewares));

I am also getting an error that says: Module not found: Error: Cannot resolve module 'redux-pack' I've gotten this trying to use both:

import { handle } from 'redux-pack'

and:

import pack from 'redux-pack'

What else can I give you to help out?

Think I figured it out. Your package.json says lib, your directory is named src.

Damn, not reading closely enough, I see in your build step, you have the output directory of lib. Sorry for the many comments.

ohhh. are you pulling it locally? You would have to run npm run build in that case

I am not trying to run it locally. I used yarn to pull it into a project, attempted to import it into a few files to verify what @stunaz was seeing.

you're right. .gitignore accidentally was setup to not publish the lib directory. please upgrade to 0.1.1 and let me know if it's fixed! Thanks.

Solved it for me.

solved too 👍
thanks