Categories
Mastering Development

Error: Cannot find module ‘ejs’, webpack does not compile the ejs module in the bundle.js file made through webpack.server.js

I keep getting the not found module for ejs and tried bunch of solutions. I am not sure why the ejs module does not compile to the file webpack builds. this is the error: Error: Failed to lookup view “pages/index” in views directory “/views” at Function.y.render (/Users/”user name”/projects/project-node-test/build/bundle.js:277:4330) package.json: “name”: “project-node”, “version”: “1.0.0”, “description”: “”, […]

Categories
Development

I cannot configure my package.js file for ReactJS

This is the error: Insufficient number of arguments or no entry found. Alternatively, run ‘webpack(-cli) –help’ for usage info. And this is the code in my package.json file: { “name”: “reactredux”, “version”: “1.0.0”, “description”: “React”, “main”: “index.js”, “scripts”: { “start”: “npm run build”, “build”: “webpack -d && copy src/index.html dist/index.html && webpack-dev-server –content-base src/ –inline […]

Categories
CSS Development Heroku Plugins

How to install dependencies on Heroku after deplyment of Node App?

I have a node app, perfectly running on the localhost. but after deploying it to Heroku it crashes. Here’s the Error Log: 2019-11-07T10:58:20.359983+00:00 heroku[web.1]: Starting process with command `npm start` 2019-11-07T10:58:22.882837+00:00 heroku[web.1]: State changed from starting to crashed 2019-11-07T10:58:22.866125+00:00 heroku[web.1]: Process exited with status 1 2019-11-07T10:58:22.768738+00:00 app[web.1]: 2019-11-07T10:58:22.768765+00:00 app[web.1]: > dpapi@1.0.0 start /app 2019-11-07T10:58:22.768768+00:00 app[web.1]: […]

Categories
Development Plugins

Got error: Plugin/Preset files are not allowed to export objects, only functions

I got this error while setup my react app using the webpack and babel. I try to change the version of babel but still getting the same error. I’m not getting where’s the problem. ERROR in ./src/index.jsx Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Plugin/Preset files are not allowed to export objects, only functions. In /home/arslan/Downloads/code/node_modules/babel-preset-es2015/lib/index.js […]

Categories
CSS Development

Next.js + Webpack: Struggling to import 3rd party SCSS into project

I am attempting to use this cool React Button Component inside my project but I do not understand where I am going wrong and how my Webpack isn’t working. Please could you help! I am also new at Webpack and I would appreciate it if you could point me in the right direction. Much Thanks […]

Categories
Development

How i improve react-native run-android build time?

I am continue developed ecommerce mobile app and my laptop a bit laggy, it reach 30m to build the apps ! How to improve the build time, is that some lib making it heavy or am i doing it wrong? 30min to build: react-native run-android execution time my spec Java version: 8 My Machine: Dell […]

Categories
Development

Not able to deploy Node server in Elasticbeanstark

I have a server written in ES6 which i need to run on ElasticBeanstalk, whenever i run it, I have these errors SyntaxError: Unexpected identifier at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) /var/app/current/app.js:1 import express from ‘express’; I […]

Categories
CSS Development

Jest SyntaxError: Unexpected token . with scss

I got this error when trying to setup Jest with React.js and webpack. Somehow Jest doesnt allow me to import files without define. How shoul I do to solve this issue? The Error ({“Object.”:function(module,exports,require,__dirname,__filename,global,jest){.title { SyntaxError: Unexpected token . import { sampleAction } from ‘../../redux/sample/sample.action’; -> import ‘./landing.styles.scss’; Thank you very much for advance jest.config.js […]