React Build Failing - how to troubleshoot - javascript

I have a React Frontend Project that works correctly with npm start - the frontend works as expected when I run it this way.
However, when I npm run build and then serve the file with express, the frontend fails. The frontend doesn't load in my browser and I see the error: Uncaught TypeError: l[e] is undefined on Firefox and Uncaught TypeError: Cannot read property 'call' of undefined on Chrome.
The stack trace associated with those errors isn't very helpful as it just directs to chunk.js. I need to somehow figure out what's causing this issue. My boss suggested someone else working on the project likely made a coding error and we'll have to clean up everything to debug (this setup was working a week ago). Is there anything I can do to debug this short of going through every line of code?
Thank you!

Related

error appears in chrome extension when importing selenium-webdriver in javascript

I am building a web extension to run automated tests using javascript, when installing and importing selenium-webdriver the extension crash showing the following message:
Uncaught TypeError: Cannot read properties of undefined (reading 'O_CREAT')
at ./node_modules/selenium-webdriver/node_modules/tmp/lib/tmp.js
this error appears for selenium-webdriver version 4.7.0
I tried older versions, till I reach version 4.3.0, then it showed a different error
Uncaught ReferenceError: Buffer is not defined
at ./node_modules/selenium-webdriver/node_modules/ws/lib/constants.js
Has anybody faced this before? and how can I solve it?
I searched everywhere for this error, but no solution. I could not figure out why it is showing this error. I tried deleting the node modules and re-installing, clearing the cache then reinstalling, installing many package that might be related to it but no luck at all.

Unable to run Playwright with cucumber due to errors

Apologies if the errors are pretty simple. I'm trying my hand at a Playwright TS repo with cucumber js. I've worked with Playwright and Cucumber before, with JS, but not TS. So, it's my first foray with TS.
I'm trying to implement the POM that I've worked in the past with my other Playwright/Cucumber projects. However I've been hit with multiple errors - have tried a lot of hit and trial methods but each one turning into a dead end.
Error -
#Smoke
Scenario: User is able to login with valid credentials # features/login.feature:3
Given User is on the "Login" Page
User is on the Login Page
✖ failed
TypeError: Cannot read property 'visit_base_url' of undefined
at /Users/Rahul_Yadav/Documents/FE-Projects/play-cuke-ts/src/step-definitions/login.step.ts:16:24
at Generator.next (<anonymous>)
at fulfilled (/Users/Rahul_Yadav/Documents/FE-Projects/play-cuke-ts/src/step-definitions/login.step.ts:5:58)
at runNextTicks (node:internal/process/task_queues:61:5)
at processImmediate (node:internal/timers:437:9)
Here is the repo for issue reproduction purposes - https://github.com/zac11/play-cuke-ts
Can someone please help me in this issue? If there are issues with configuration, the please also mention what updates I should do.

Does someone encounter such an error: "Uncaught TypeError: t.mount is not a function"

If open this error in the browser there is the next piece of code:
return this.isMounted&&n&&(t.mount(this.node),this._emitter.emit(A,t.node))
so the error on the t.mount(this.node)
It is minified React code. It's obvious that it does not tell nothing, so I went to build folder and searched for ".mount(" and it found the next piece of code in .app.js file:
symbol.mount(sprite.node)
which looks like the pice of code with the error.
I google for symbol.mount typeerror, but could extract any useful suggestion.
Maybe someone encounter something similar or have and idea what could it be?
Additional info: there is no error when project is run locally (even when built locally), only when deployed on the remote server..

DOMException error creating AudioWorlet with Webpack

I got an error when trying to create an AudioWorklet, but only when the project is served through webpack-dev-serve. If I serve the files directly with an http server, everything works fine. So I think it must be something related with Webpack configuration.
This is the error I get:
audio-meter.js:19 Uncaught (in promise) DOMException: Failed to construct 'AudioWorkletNode': AudioWorkletNode cannot be created: The node name 'audio-meter' is not defined in AudioWorkletGlobalScope.
at new AudioMeterNode (http://localhost:9999/bundle.js:9421:17)
at Function.create (http://localhost:9999/bundle.js:9430:16)
I've been searching and there are some related questions, but none of them helped me to solve the problem. One of them points to a Chromium bug, but in this case the error only happens when the project is served through Webpack (I'm using worker-loader plugin):
AudioWorklet DOMException error when loading modules
AudioWorklet error: DOMException: The user aborted a request
Use AudioWorklet within electron (DOMException: The user aborted a request)
I've set up here a branch with the most simplified version of the project I've could, there are some files involved so I think you could see it better this way. To get it, please: git clone git#bitbucket.org:alvaro_maceda/notoono.git and git checkout stackoverflow.
If you run it with npm start it will use Webpack and, when you press the "start" button, you will see the error on the console. If you comment audio-meter.js:11 and uncomment audio-meter.js:11 and index.html:14 you can run it with npm start http and everything will go fine.
Could anybody give an idea about what to search or where the error could be?

Meteor Javascript Uncaught ReferenceError: Package is not defined

I am new Meteor and have recently been working on a starter project. Everything was going just fine and was halfway through when all of a sudden Meteor stopped working. However, I am have a lot of trouble pinpointing what is wrong.
My console still reads
[[[[[ ~/Desktop/Coding/Meteor/mine ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
However, when I open the Chrome console I am getting
Uncaught ReferenceError: Package is not defined(anonymous function)
These packages are defined for us by Meteor and I have not touched them once (nor do I know how to). Can someone help point me in the right direction? I tried re-installing Meteor as well as starting a new sample project and I am still getting the same errors in the console.

Categories

Resources