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
Mastering Development

How to publish my npm package in GitLab NPM Registry?

I hooked up a trial gold plan to test GitLab NPM Registry functionality. Created a gitlab prohect with the name “bar”. Created a file to generate a token: in the file with the name auth.txt I wrote the line: grant_type=password&username=my-gitlab-username& password=my-gitlab-password Generated a token using the command: curl -d “@ auth.txt” -X POST http:/gitlab.com/oauth/token In […]

Categories
Mastering Development

TypeScript project in NPM not a constructor

I have an npm module built with TypeScript.. and I cannot seem to require() the module in other code MyClass4TS myclass4ts.ts class MyClass4TS { constructor(){ } } export { MyClass4TS } edit: Also tried attaching export to the class, to no effect export default class MyClass4TS { constructor(){ } } MyClass4TS package.json { “name”: “myclass4ts”, […]

Categories
Mastering Development

VueJS not render data on DOM inside electron application

I have an electron project where I’m implementing vuejs inside it. I’m able to load vue script and the browser window will open correctly the index.html file that contains the GUI that is made using bootstrap 4. I’ve noticed that the vue instance will not process the syntax that is used by vue. I don’t […]

Categories
Mastering Development

Published npm package does not apply styles

I’m currently working on creating an npm package. Which is basically a React component with added styles using SCSS. When I test it out, the class names are there, but no styles are being applied. Here is the repo for the package. I use a separated webpack config for building the specific folder where the […]

Categories
Mastering Development

Why is document not defined in Electron renderer.js file?

I am creating a desktop app with Electron. I am trying to run a Python script when I click a button (made from HTML) on the app. I did this by using child_process and spawn. However, when I run npm start with command prompt (Windows 10) in the directory, I am getting that document is […]

Categories
Development

Why is the calculation result different between sassmeister and local environment?

I do complicated calculations. For example, the following mixin returns 0.00000096 for SassMeister (used in compiler dart-sass v1.18.0). But with gulp-dart-sass this gives different results (9.6000002259). Why is this? I want it to work like SassMeister. Sass file $x: 0.98; $a: 300; @function f($x){ $x: 1 – $x; @return 1 – $x * $x * […]

Categories
Development

babel-plugin-macros – MacroError: The macro you imported from “undefined” is being executed

I got a Gatsby website project. Since Gatsby’s default babel config contains babel-plugin-macros I don’t need much to set it up. E.g. I’ve installed preval.macro and it works fine. Now I want to create my own macro to do some stuff. So I created a new NPM package containing only the package.json, index.js and macro.js. […]

Categories
Development

“Module not found: Error: Can’t resolve ‘electron-is-dev'” in electron & typescript & webpack project

I’m using Electron and Typescript with webpack. And I’m gonna add react.js. But I typed “npx webpack”, I got an error. It says “electron-is-dev module is not found”, but I already installed it. ERROR in ./src/main/window.ts Module not found: Error: Can’t resolve ‘electron-is-dev’ in ‘project-path/src/main’ @ ./src/main/window.ts 2:0-36 12:35-40 @ ./src/main/app.ts I can’t find how […]

Categories
Development

Webpack dev server reloads but doesn’t show Markup or CSS changes?

So i’m pretty new to Webpack, and I finally got the webpack-dev-server running. It recompiles and refreshes page on save, and it shows changes to my JS code. But it doesn’t seem to work well with my SASS or HTML files? On a fresh start, it will show a change if I make it, but […]