Understanding Rails with webpacker and incidence on JS

Issue A rails 6 application calls from a legacy application being migrated: <%= javascript_pack_tag ‘zxing.js’ %> <script type="text/javascript"> window.addEventListener(‘load’, function () { let selectedDeviceId; const codeReader = new ZXing.BrowserMultiFormatReader() console.log(‘ZXing code reader initialized’) codeReader.listVideoInputDevices() .then((videoInputDevices) => { const sourceSelect =

Continue reading

NodeJs :- 92% chunk asset optimization TerserPlugin FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed – JavaScript heap out of memory

Issue I’ve following dependencies and huge set of components in react and using storybook and webpack, “@storybook/react”: “5.0.6”, “styled-components”: “5.0.1”, “typescript”: “3.5”, “webpack”: “4.39.3”, “webpack-cli”: “3.3.7” locally everything was working fine while building storybook at remote it was continuously failing

Continue reading

webpack-dev-server hot reload not working

Issue My file structure is: dist css style.css index.html js bundle.js src css style.css index.html js main.js node_modules webpack.config.js package.json My webpack.config.js looks like: module.exports = { entry: ‘./src/js/main.js’, output: { path: __dirname, filename: ‘./dist/js/bundle.js’ }, module: { loaders: [

Continue reading

webpack: Module not found: Error: Can't resolve (with relative path)

Issue I have this structure of an app (node_modules dir excluded from this list): ā”œā”€ā”€ actions.js ā”œā”€ā”€ bundle.js ā”œā”€ā”€ components ā”‚Ā Ā  ā”œā”€ā”€ App.js ā”‚Ā Ā  ā”œā”€ā”€ Footer.js ā”‚Ā Ā  ā”œā”€ā”€ Link.js ā”‚Ā Ā  ā”œā”€ā”€ Todo.js ā”‚Ā Ā  ā””ā”€ā”€ TodoList.js ā”œā”€ā”€ Containers ā”‚Ā Ā  ā”œā”€ā”€ AddTodo.js

Continue reading

Issue with node-sass while compiling asset – npm

Issue I am getting this error on npm run prod npm run prod > @ prod /opt/atlassian/pipelines/agent/build > encore production Running webpack … ERROR Failed to compile with 2 errors4:15:08 PM error in ./web/assets/src/scss/styles.scss Module build failed: $navbar-padding-horizontal: floor(math.div($grid-gutter-width, 2))

Continue reading

Angular Proxy in root level

Issue I have an Angular application and a landing page written in jQuery. I want to serve the landing page every time the request is on the root of http://mywebsite.com. Anything else, let’s say http://mywebsite.com/otherpage, I want to serve the

Continue reading

Can't use local file images in Next 12

Issue Created a new project in Next js with Next version 12. Whenever I try to import and use an image file in the /public directory I get a build failure. ../public/images/header-logo.jpg TypeError: fetch failed at Object.processResponse (node:internal/deps/undici/undici:5575:34) at node:internal/deps/undici/undici:5901:42

Continue reading