Thanks Mark J. I got error when running 'npm run build'. So I followed your suggestions, checked for file structure and used your webpack.config.js.
I got passed this error. However, when I load the app, add/delete/all work but update function didn't work (.save callback function didn't fire).
So I made this change and it's now working:
todo.save({ function (error, todo) { ... } })
Changed to (removed {})
todo.save( function (error, todo) { ... } )
Based on suggestions on best practice, I also changed file names to lowercase (todo.js, routes.js, config.js) and variable Todo -> todo.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks Mark J. I got error when running 'npm run build'. So I followed your suggestions, checked for file structure and used your webpack.config.js.
I got passed this error. However, when I load the app, add/delete/all work but update function didn't work (.save callback function didn't fire).
So I made this change and it's now working:
todo.save({
function (error, todo) {
...
}
})
Changed to (removed {})
todo.save(
function (error, todo) {
...
}
)
Based on suggestions on best practice, I also changed file names to lowercase (todo.js, routes.js, config.js) and variable Todo -> todo.