Giter Club home page Giter Club logo

Comments (9)

danielr18 avatar danielr18 commented on September 22, 2024 1

@amaioru0 Are you trying to import something from connected-next-router/actions?

from connected-next-router.

amaioru0 avatar amaioru0 commented on September 22, 2024 1

Hi @danielr18 , I resolved the error. I was importing from actions as you mentioned but didn't realize it.

Thanks for your help!

from connected-next-router.

danielr18 avatar danielr18 commented on September 22, 2024

Can you create a small reproduction?

from connected-next-router.

amaioru0 avatar amaioru0 commented on September 22, 2024

I am not sure how to reproduce it but this is the new error I am getting:

ModuleNotFoundError: Module not found: Error: Package path ./actions is not exported from package /root/homebox-next/node_modules/connected-next-router (see exports field in /root/homebox-next/node_modules/connected-next-router/package.json)

Can you help? @danielr18

from connected-next-router.

amaioru0 avatar amaioru0 commented on September 22, 2024

No, I am not

from connected-next-router.

amaioru0 avatar amaioru0 commented on September 22, 2024

Here is my redux file:

`import { createStore, applyMiddleware, combineReducers } from 'redux'
import { createRouterMiddleware, initialRouterState, routerReducer } from 'connected-next-router'
import { format } from 'url'
import { HYDRATE, createWrapper } from 'next-redux-wrapper'
import Router from 'next/router'

import thunkMiddleware from 'redux-thunk'
import reducers from './reducer'

import { createLogger } from 'redux-logger';

const logger = createLogger();

const bindMiddleware = (middleware) => {
const { composeWithDevTools } = require('redux-devtools-extension')
return composeWithDevTools(applyMiddleware(...middleware))
}

const reducer = (state, action) => {
if (action.type === HYDRATE) {
const nextState = {
...state, // use previous state
...action.payload, // apply delta from hydration
}
if (typeof window !== 'undefined' && state?.router) {
// preserve router value on client side navigation
nextState.router = state.router
}
return nextState
} else {
return reducers(state, action)
}
}

export const initStore = (context) => {
const routerMiddleware = createRouterMiddleware()
const { asPath, pathname, query } = context.ctx || Router.router || {};
let initialState
if (asPath) {
const url = format({ pathname, query })
initialState = {
router: initialRouterState(url, asPath)
}
}
// return createStore(reducer, initialState, bindMiddleware([routerMiddleware, thunkMiddleware, logger]))
return createStore(reducer, initialState, bindMiddleware([routerMiddleware, thunkMiddleware]))
}

export const wrapper = createWrapper(initStore)`

from connected-next-router.

amaioru0 avatar amaioru0 commented on September 22, 2024

@danielr18 any advice? Is the only error I am getting and is stoping me from launching my project. I would appreciate your help enormously.

from connected-next-router.

danielr18 avatar danielr18 commented on September 22, 2024

@amaioru0 I can't recreate the issue. Can you create a simple repository with the package versions you are using where the issue occurs?

from connected-next-router.

amaioru0 avatar amaioru0 commented on September 22, 2024

Here is the package.json file https://github.com/amaioru0/connected-next-router/tree/main @danielr18 . Thank you for looking into it.

from connected-next-router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.