Categories
Development

You may need an appropriate loader to handle this file type error occurs in ReactJS file

I have divided my configuration in to two production and development mode and merging them using webpack-merge. Whenever i try to build or run the code it gives me you may need an appropriate loader error even though i have define loader for the jsx or js files. Common Config File code is here… const […]

Categories
Development

Module not found: Error: Can’t resolve ‘./router’ in ‘C:\HK\Vue-learning\testapp1\src’

I am new to Vue js. I have installed a basic vue template and added a web pack for bundling. But when I use “webpack –config webpack.config.js” to build the app I am getting the following error. **ERROR in ./src/main.ts Module not found: Error: Can’t resolve ‘./router’ in ‘C:\HK\Vue-learning\testapp1\src’ @ ./src/main.ts 2:0-30 7:12-18 ERROR in […]

Categories
Cryptocurrency Development Ethereum

Getting error -> unexpected token. You may need an appropriate loader to handle this file type

root@kali:~/Documents/oraclize-test# npm run dev truffle-oraclize-api@0.0.2 dev /root/Documents/oraclize-test webpack-dev-server ERROR in ./app/javascripts/app.js Module parse failed: /root/Documents/oraclize-test/app/javascripts/app.js Unexpected token (124:0) You may need an appropriate loader to handle this file type. | }) | } | @ multi (webpack)-dev-server/client?http://localhost:8081 ./app/javascripts/app.js webpack: Failed to compile. APP.JS // Import the page’s CSS. Webpack will know what to do with […]

Categories
Development

Webpack-Dev-Server constructs improper SockJS: “An insecure SockJS connection may not be initiated from a page loaded over HTTPS”

I’ve been struggling with this awkward issue for well over a week now and couldn’t resolve it. Any help will be highly appreciated! I’m building a web application that uses Nginx as the proxy, React for web’s front-end, GoLang for my backend API. The entire application is running on Docker (version 19.03.5). After I ran […]

Categories
Development

React Development and Build version not working in IE 11 and Edge – Webpack/Babel

Development and build version not working in IE 11 and Edge. Here are my webpack config and package json file. I have used below repo. https://github.com/kriasoft/react-starter-kit I have been trying to fix this issue using various babel packages and webpack configurations. Arrow function seems not to be working. Here’s the error. webpack.config.js /** * React […]

Categories
Development

Webpack doesn’t resolve index file in folder

I have the project in which I use React with Typescript and Webpack to bundle all together. I know that if there’s index.tsx file in folder in which I export all necessary files, I can import items from folder like import { item } from ‘path/to/folder’ instead of import { item } from ‘path/to/folder/and/file.tsx’ But […]

Categories
Development

react app with webpack built from scratch is not loading an image in css

I built a simple react app that uses webpack and babel. I am having trouble loading my images. My basic folder structure: root: webpack.config.js package.json public: index.html src: 800×600-1x2x.jpg App.css App.js index.js App.js is boilerplate code: import React, { Component} from “react”; import {hot} from “react-hot-loader”; import “./App.css”; class App extends Component{ render(){ return( <div […]

Categories
Development Plugins Vue

Vuejs + webpack shows blank page after importing js file

Vuejs + webpack (development environment) shows blank page after importing core.min.js file inside Footer.vue file. console shows no error. To view the code of core.min.js check https://drive.google.com/file/d/1IYcH31j2lqh96ZlNgdXr6wnqrq2HAWCK/view Note:I only import core.min.js . App.vue <template> <div id=”app”> <div class=”page”> <app-header></app-header> <app-home></app-home> <app-footer></app-footer> </div> </div> </template> <script> export default { data () { return { msg: ‘Welcome […]

Categories
Development Plugins React

How to reduce bundle size of react app even further

I am trying to reduce the size of my build file ( main.js ) to 500kb or less. Initially it was 1.2MB and with some code splitting and webpack I managed to reduce it to around 600kb but I need to reduce it by another 100kb. I am fairly new to webpack and I would […]

Categories
CSS Development Plugins

Computed Properties not working with Babel preset-env

I’m trying to use computed properties in my Material UI style object, but I’ve getting an unexpected token error. Below is the code snippet, error, and babel-webpack config. const useStyles = makeStyles(theme => { root: { [desktop]: { width: “80%”, } } }); //webpack.config.babel.js … const config = { entry: [‘@babel/polyfill’, ‘./src/components/index.js’], resolve: { extensions: […]