Throws error after 'import mongodb'
See original GitHub issueThe whole application throws an error after import 'mongodb'
App.js file
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import 'bulma/css/bulma.css';
import 'mongodb';
.....
Error message outputs
client:47 ./~/resolve-from/index.js Module not found: Error: Cannot resolve module 'module' in W:\FAdeniyi\My Documents\sublime\ipay\node_modules\resolve-from resolve module module in W:\FAdeniyi\My Documents\sublime\ipay\node_modules\resolve-from looking for modules in W:\FAdeniyi\My Documents\sublime\ipay\node_modules W:\FAdeniyi\My Documents\sublime\ipay\node_modules\module doesn't exist (module as directory) resolve 'file' module in W:\FAdeniyi\My Documents\sublime\ipay\node_modules resolve file W:\FAdeniyi\My Documents\sublime\ipay\node_modules\module doesn't exist W:\FAdeniyi\My Documents\sublime\ipay\node_modules\module.js doesn't exist W:\FAdeniyi\My Documents\sublime\ipay\node_modules\module.json doesn't exist [W:\FAdeniyi\My Documents\sublime\ipay\node_modules\module] [W:\FAdeniyi\My Documents\sublime\ipay\node_modules\module] [W:\FAdeniyi\My Documents\sublime\ipay\node_modules\module.js] [W:\FAdeniyi\My Documents\sublime\ipay\node_modules\module.json] @ ./~/resolve-from/index.js 3:13-30
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top GitHub Comments
No worries. Its React Routers
Yep. Then you would use something like
fetch()
to talk from the frontend React app to your Node (or whatever) backend app.Check out this tutorial: https://www.fullstackreact.com/articles/using-create-react-app-with-a-server/
I hope this helps! It doesn’t use a real database, but you can take that example Node app and add Mongo to it.