All Questions
929
questions
2343
votes
67
answers
3.0m
views
Error message "error:0308010C:digital envelope routines::unsupported"
I created the default IntelliJ IDEA React project and got this:
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (...
340
votes
32
answers
531k
views
The create-react-app imports restriction outside of src directory
I am using create-react-app. I am trying to call an image from my public folder from a file inside my src/components. I am receiving this error message.
./src/components/website_index.js Module not ...
26
votes
3
answers
56k
views
Why am I getting ReferenceError: self is not defined when I import a client-side library?
Trying to create an xterm react component in Next.js I got stuck as I'm not able to get over an error message I've never got before.
I'm trying to import a npm client-side module called xterm, but if ...
169
votes
6
answers
145k
views
Dynamically import images from a directory using webpack
So here's my current workflow for importing images and icons in webpack via ES6:
import cat from './images/cat1.jpg'
import cat2 from './images/cat2.svg'
import doggy from './images/doggy.png'
import ...
231
votes
14
answers
644k
views
Correct path for img on React.js
I have some problem with my images on my react project. Indeed I always thought that relative path into src attribute was built on the files architecture
Here my files architecture:
components
...
342
votes
8
answers
351k
views
babel-loader jsx SyntaxError: Unexpected token [duplicate]
I'm a beginner in React + Webpack.
I found a weird error in my hello world web app.
I'm using babel-loader in webpack to help me convert jsx into js, but it seems like babel can't understand jsx ...
11
votes
2
answers
11k
views
React-router with BrowserRouter / browserHistory doesn't work on refresh
I have the following webpack config file:
var webpack = require('webpack');
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, 'src/client/public');
var APP_DIR = path.resolve(...
175
votes
23
answers
199k
views
Support for the experimental syntax 'classProperties' isn't currently enabled
While I was setting up React within Django project I came across this error
ModuleBuildError in
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\...
655
votes
23
answers
494k
views
Error: 'node-sass' version 5.0.0 is incompatible with ^4.0.0
I've created a blank React project, using the command: npx create-react-app on npm v7.0.7 and Node.js v15.0.1
Installed:
React v17.0.1,
node-sass v5.0.0,
Then I tried to import a blank .scss file to ...
178
votes
7
answers
286k
views
How to load image files with webpack file-loader
I am using webpack to manage a reactjs project. I want to load images in javascript by webpack file-loader. Below is the webpack.config.js:
const webpack = require('webpack');
const path = require('...
155
votes
11
answers
584k
views
How to import image (.svg, .png ) in a React Component
I am trying to import an image file in one of my react component. I have the project setup with web pack
Here's my code for the component
import Diamond from '../../assets/linux_logo.jpg';
export ...
82
votes
7
answers
150k
views
Dynamically Add Images React Webpack
I've been trying to figure out how to dynamically add images via React and Webpack. I have an image folder under src/images and a component under src/components/index. I'm using url-loader with the ...
92
votes
6
answers
145k
views
ES6 modules implementation, how to load a json file
I'm implementing an example from https://github.com/moroshko/react-autosuggest
Important code is like this:
import React, { Component } from 'react';
import suburbs from 'json!../suburbs.json';
...
413
votes
12
answers
559k
views
How to add fonts to create-react-app based projects?
I'm using create-react-app and prefer not to eject.
It's not clear where fonts imported via @font-face and loaded locally should go.
Namely, I'm loading
@font-face {
font-family: 'Myriad Pro ...
99
votes
28
answers
184k
views
firebase.auth is not a function
I am using Webpack with firebase and firebase-admin.
To install firebase I ran:
npm install --save firebase
I am importing firebase using:
import * as firebase from 'firebase/app'
import 'firebase/...