mern

React App failed to compile after install

浪子不回头ぞ 提交于 2020-07-08 05:23:42
问题 After running the install script, the server starts and serves a page displaying the same text after the 'Failed to compile line.' I'm running Windows 10 and auto update just updated my pc today, right before I did the create-react-express install. PS H:\mern-passport> npm start > mern@1.0.0 start H:\mern-passport > if-env NODE_ENV=production && npm run start:prod || npm run start:dev > mern@1.0.0 start:dev H:\mern-passport > concurrently "nodemon --ignore 'client/*'" "npm run client" [0]

React App failed to compile after install

不羁的心 提交于 2020-07-08 05:22:20
问题 After running the install script, the server starts and serves a page displaying the same text after the 'Failed to compile line.' I'm running Windows 10 and auto update just updated my pc today, right before I did the create-react-express install. PS H:\mern-passport> npm start > mern@1.0.0 start H:\mern-passport > if-env NODE_ENV=production && npm run start:prod || npm run start:dev > mern@1.0.0 start:dev H:\mern-passport > concurrently "nodemon --ignore 'client/*'" "npm run client" [0]

Atlas MongoDB connection

て烟熏妆下的殇ゞ 提交于 2020-06-16 17:10:51
问题 I am trying to connect to Atlas MongoDB with the following URI (provided by mongodb connection string ) module.exports = { mongoURI:'mongodb+srv://<user>:<password>@cluster0-un6sk.mongodb.net/test? retryWrites=true' }; //connect to mongoose mongoose .connect(db) .then( ()=>console.log('mongoDB connected')) .catch(err => console.log(err)); I get the following error : { MongoNetworkError: connection 3 to cluster0-shard-00-00-un6sk.mongodb.net:27017 closed at TLSSocket.<anonymous> (C:\Users

NODEMON — app crashed - waiting for file changes before starting

ぃ、小莉子 提交于 2020-05-28 04:35:06
问题 I'm following this tutorial. When I run 'npm run server' , as at 13:10 in the video, I get the error: [nodemon] app crashed - waiting for file changes before starting... Why does this happen? Is Port 5000 already in use? Here's the terminal: MyComputer:MERN_SHOPPING_LIST MyName$ npm run server mern_shopping_list@1.0.0 server /Users/MyName/Documents/Web Dev/MERN_SHOPPING_LIST nodemon server.js [nodemon] 1.18.3 [nodemon] to restart at any time, enter rs [nodemon] watching: . [nodemon] starting

What structure for create tree category and set in posts is better? and find posts by selected category in MERN

∥☆過路亽.° 提交于 2020-04-30 06:37:07
问题 I'm using MERN to develop my project, I have tree category with this structure: {id: { type: Number }, parent_id: { type: Number }, name: { type: String }, sub: { type: Boolean }} for example : { "_id": "5dfa22dbb04cee3960868fd8", "id": 1, "name": "Code", "parent_id": 0, "sub": true, "__v": 0 }, { "_id": "5dfa2358b04cee3960868fda", "id": 101, "parent_id": 1, "name": "JavaScript", "sub": true, "__v": 0 }, { "_id": "5dfa68735dc1004134b259ab", "id": 1001, "parent_id": 101, "name": "React", "sub"

React JS Refuse to load the image because it violates the following Content Security Policy directive

前提是你 提交于 2020-03-28 06:40:08
问题 I faced this problem when I try to reload my react application web page. Note: In the development phase there was no issue with this kind of thing, but when I deploy it to production I faced this issue. Thank you. Refused to load the image 'http://104.248.153.121:8080/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback. Here is an error image log: Error Log

Heroku, NodeJs and React issue: SCRIPT5007: Unable to get property 'apply' of undefined or null reference

时间秒杀一切 提交于 2020-02-24 12:16:17
问题 I have a weird issue with, I guess, polyfills. I used MERN stack for my app, and pushed to Heroku. For some reason, on my computer in Chrome I can view the website, however, on other computers I'm getting a blank page and the error in console: 'SCRIPT5007: Unable to get property 'apply' of undefined or null reference' it points to this chunk of code, and, apparently, is linked to Redux: return funcs.reduce(function (a, b) { return function () { return a(b.apply(undefined, arguments)); }; });

How to get Mern Stack to work on Heroku

喜夏-厌秋 提交于 2020-01-14 06:05:07
问题 I'm testing out the Mern Stack (Mongo Express React/Redux Node) and set it up with development with no issue. Now I'm trying to deploy to Heroku. I did a git push heroku master just like normal, but when I check out the website I see Heroku's Application Error. I added a MongoDB through Heroku, and changed my heroku config variables, so it uses that db (I think I did this correctly). So I check into logs: npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn

TypeError: Cannot read property 'attach' of undefined makeStyles.js

本小妞迷上赌 提交于 2020-01-03 07:24:12
问题 First post here and I'm on wits end, any help would be kindly appreciated. When trying to access the Login component of my MERN app on the production version, I get a series of the following type errors shown in this image: My app (https://github.com/ahaq0/kumon_schedule) works perfectly fine locally and was working perfectly fine hosted on heroku earlier today. I tried rolling back all of the changes in the code that I made today to no avail. Similarly, I checked the package.json (and .lock)