Why store module not found: Error: Can't resolve '../store/todo' in '/opt/render/project/src/client/components'

I finally to seeded my data from database. However, the system can not read redux store. Any help will be appreciated!!! :sob::sob::sob::sob::sob::sob:


This is my webpack.config.json

module.exports = {
  entry: ['./client/index.js'],
  output: {
    path: __dirname,
    filename: './public/bundle.js'
  },
  context: __dirname,
  devtool: 'source-map',
  module: {
    rules: [
      {
        test: /jsx?$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
        options: {
          presets: ['@babel/preset-react']
        }
      }
    ]
  }
}

I have been trying to deploy on render. In the local, it works fine. not sure what happened? :thinking:

“It works fine locally” is something that we hear a lot.

However, deploying to a Cloud provider differs greatly from your local environment so it’s not a particularly useful comparison.

“Module not found” is the error you need to fix here, the error shows ../store/todo so that’s the reference to the import in your code - is that actually correct?

The key to this specific error you are experiencing here is that our servers run Linux, and Linux is a case-sensitive file system.

John B

Hi John, I recognized that so I continually check my files, folders, and so on. However, I have a question about can I use react-redux in my app and can render deploy that? I found out that render does not understand “axios.get(/api/todos)”

export const updateTodo = (todo, history) => {
	return async (dispatch) => {
		try {
			const { data } = await axios.put(`/api/todos/${todo.id}`, todo);
			dispatch(_updateTodo(data));
			history.push('/');
		} catch (error) {
			console.log(error)
		}
  };
}

and something like middleware

import {createStore, applyMiddleware, combineReducers} from 'redux'

import {createLogger} from 'redux-logger'

import thunk from 'redux-thunk'

import todos from './todos'

const reducer = combineReducers({

todos

})

const store = createStore(reducer, applyMiddleware(thunk, createLogger({collapsed:true})))

export default store

Hi there,

React/Redux etc works fine on Render - this will be an error in your application here - how does it behave locally?

Regards,

John B

Every action is deployed ok.

I think i just gave up. I have been trying for over 7 days.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.