Categories
Mastering Development

Can’t use createRef in latest version of create-react-app

I am learning React using create-react-app, and I’m getting this error in my app: TypeError: react__WEBPACK_IMPORTED_MODULE_0___default.a.createRef() is not a function Now, I know that this feature was only introduced in React 16.3, but that seems to be the version I have installed. I initialized everything by typing: npx create-react-app probando02 If I check my version: […]

Categories
Mastering Development

Showing error in yarn start command says This package doesn’t seem to be present in your lockfile; try to make an install to update your resolutions

The error shown when yarn start command is given Error details: Internal Error: confusion@workspace:.: This package doesn’t seem to be present in your lockfile; try to make an install to update your resolutions at J.getCandidates (C:\Users\risha\Desktop\Front-End Web Development with React\.yarn\releases\yarn-berry.js:2:276872) at i.getCandidates (C:\Users\risha\Desktop\Front-End Web Development with React\.yarn\releases\yarn-berry.js:2:266282) at C:\Users\risha\Desktop\Front-End Web Development with React\.yarn\releases\yarn-berry.js:2:286432 at C:\Users\risha\Desktop\Front-End […]

Categories
Mastering Development

Fetch call returns react index.html and chrome gives error Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

I am trying to fetch data from my local express server, and display it with react, but it seems that the index.html of the react app is being returned. If I check the network tab in the console and it shows that there is a fetch request with the name "projects/" and when I hover […]

Categories
Mastering Development

Fetch call returns react index.html and chrome gives error Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

I am trying to fetch data from my local express server, and display it with react, but it seems that the index.html of the react app is being returned. If i check the network tab in the console and it shows that there is a fetch request with the name "projects/" and when i hover […]

Categories
Mastering Development

You may need an appropriate loader to handle this file type, currently no loaders are configured to process file

I just created a project using create-react-app (in javascript). In that, I am linking one of my other repository like this { "name": "hh-frontend-example", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", "hh-stylesheet": "file:../hh-stylesheet", "react": "^16.13.1", "react-dom": "^16.13.1", "react-scripts": "3.4.1" }, Here notice this line: "hh-stylesheet": "file:../hh-stylesheet", Now, When I start […]

Categories
Mastering Development

reactjs application – can’t get my hello world to show up

Background / Problem I’m trying to build understand my first react/webpack/nodejs app. I am able to build / launch it by opening a browser and navigating to http://localhost:3333/ , but the hello world message I’m expecting is not showing. Instead I think it’s trying to give me a directory listing of a folder…? Not too […]

Categories
Mastering Development

How to fix Next.js Vercel deployment module not found error

My next.js app works on my machine and was working when deployed on Vercel but now it fails when building on Vercel with the following error: I’ve tried deleting node_modules and running npm install a few times but with no joy. Any help would be hugely appreciated. Thank you! Analyzing source code… 21:30:52.642 Installing build […]

Categories
Mastering Development

Module not found for React Ntaive Webrtc while creating Android build

I added Webrtc https://www.npmjs.com/package/react-native-webrtc module in my react-native-web app. I used npm i -s react-native-webrtc command. But while creating a build I am getting below error: Error: Error: Unable to resolve module react-native-webrtc from App.js: react-native-webrtc could not be found within the project or in these directories: node_modules If you are sure the module exists, […]

Categories
Mastering Development

Error 401 while reloading Jwt secured spring Boot React app (and configuration problems)

I’m learning spring boot and react. I have successfully learnt how to use the frontend maven plugin to combine the two. Also JWT kind of works (at least an api call returns what I want while the token is alive and returns error when i set quick expiration time). But react routes work weirdly. I […]

Categories
Mastering Development

My react app on heroku opens home page but will not open other pages

My react app runs fine locally, and deploys to heroku. However, from the home page, any link to another page shows a blank page with ‘not found’ on it. There are no other error messages. Here is my server-side package.json file: { “name”: “portfolio-generator”, “version”: “1.0.0”, “description”: “”, “main”: “server.js”, “engines”: { “node”: “12.16.x” }, […]