DOM Exception while registering the service worker

I am getting this error when I am trying to register the service worker in my project. Its in react 15.1.

DOMException: Failed to register a ServiceWorker for scope (‘http://localhost:3000/az24416/’) with script (‘http://localhost:3000/az24416/serviceworker.js’): The script has an unsupported MIME type (‘text/html’).

export default function swDev(){
    let swUrl = `/serviceworker.js`
    console.log(navigator.serviceWorker);
    navigator.serviceWorker.register(swUrl).then((response)=>{
        console.log(response);
    }).catch((error)=>{
        console.log(error);
    })
}

How do I fix this Javascript code on Chromebook?

I’m trying to fix a bug on https://github.com/betweenTheBrackets/windows-3.1-flying-windows-screensaver

When I download it and run it, the Windows logos aren’t rendering instead just being rendered as coloured rectangles. This is on ChromeOS by the way.
Here is the app.js code:

const scene = new THREE.Scene();
const fov = 75;
const aspect = window.innerWidth / window.innerHeight;
const near = 0.1;
const far = 1000;
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
const renderer = new THREE.WebGLRenderer();
const loader = new THREE.TextureLoader();

renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

const flyingWindows = createFlyingWindows(40);
flyingWindows.forEach(flyingWindow => scene.add(flyingWindow));

camera.position.z = 2;

animate();
window.addEventListener('resize', onWindowResize, false);

function animate() {
  requestAnimationFrame(animate);
  camera.position.z -= 0.7;

  flyingWindows.forEach(flyingWindow => {
    if (camera.position.z < flyingWindow.position.z) {
      randomlyPositionFlyingWindow(flyingWindow, camera);
    }
  });

  renderer.render(scene, camera);
}

function createFlyingWindows(qty) {
  // width and height are based on the aspect of the Windows logo image
  const width = 1.235;
  const height = 1;
  // arbitrary depth to make it appear flat enough
  const depth = 0.01;

  const geometry = new THREE.BoxGeometry(width, height, depth);
  const flyingWindows = [];

  const windowImageMaterial = new THREE.MeshBasicMaterial({
    map: loader.load('window-filter.png'),
    transparent: true,
    side: THREE.FrontSide,
  });

  const blackMaterial = new THREE.MeshBasicMaterial({
    color: 0x000000,
    side: THREE.DoubleSide,
    polygonOffset: true,
    polygonOffsetFactor: -1,
    polygonOffsetUnits: 1,
  });

  for (let i = 0; i < qty; i++) {
    const color = getRandomColor();

    // put color on both sides so transparent front can show color from inside box
    const colorMaterial = new THREE.MeshBasicMaterial({
      color,
      side: THREE.BackSide,
    });

    const materials = [
      blackMaterial,
      blackMaterial,
      blackMaterial,
      blackMaterial,
      windowImageMaterial, // side facing camera
      colorMaterial,       // back inside facing camera
    ];

    const flyingWindow = new THREE.Mesh(geometry, materials);
    randomlyPositionFlyingWindow(flyingWindow, camera);

    flyingWindows.push(flyingWindow);
  }

  return flyingWindows;
}

function randomlyPositionFlyingWindow(flyingWindow, camera) {
  // use the camera's z position to determine where to place them on the z axis
  flyingWindow.position.z = camera.position.z - Math.floor(Math.random() * 50) - 100;
  const distance = Math.abs(camera.position.z - flyingWindow.position.z);

  // based on how far away the flyingWindow is, push its X and Y position
  // add a little bit at the end to keep it away from the center slightly
  flyingWindow.position.x = Math.floor(Math.random() * (distance / 3)) + 0.5;
  flyingWindow.position.y = Math.floor(Math.random() * (distance / 3)) + 0.5;

  if (Math.random() > 0.5) {
    flyingWindow.position.x *= -1;
  }

  if (Math.random() > 0.5) {
    flyingWindow.position.y *= -1;
  }

  // reset the color with each reset (and leave the face with the Windows logo alone)
  const color = getRandomColor();
  flyingWindow.material[0].color.setHex = color;
  flyingWindow.material[1].color.setHex = color;
  flyingWindow.material[2].color.setHex = color;
  flyingWindow.material[3].color.setHex = color;
  flyingWindow.material[5].color.setHex = color;
}

function onWindowResize() {
  camera.aspect = window.innerWidth / window.innerHeight;
  camera.updateProjectionMatrix();
  renderer.setSize(window.innerWidth, window.innerHeight);
}

I don’t know what’s causing the problem in the first place so if anyone knows please tell me.

I tried to change the window-filter.png file (which by the way all of the files are in the same folder) to the file:///home/chronos/ etc. etc.
Didn’t work.

Used AI error fixers on all the files.
Didn’t work.

Again, please tell me what’s causing the problem and send me the fixed code if you can.

Can’t call JS functions from C# in ASP.NET

Trying to send post requests to a parent page from JS by calling

function sendPostMessage(message) {
    console.log("sending post");
    var post = { conf: message };
    parent.postMessage(post, "*");
}

from c# as in

private void post_to_parent(string message)
{
    Debug.WriteLine($"Sending post: {message}");
    ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), $"sendPostMessage("{message}");", true);

}

But I get no response.

If I call the function from the same JS everything works fine.
If I call it from the C# function, I get the message in the debug console, but nothing in the JavaScript console. No message, nothing.

I am able to call other JS functions the same way and it works fine.

I am on an ASP.NET Web Form.

Dynamically Update jscolor palette after setting default

I am wanting to use jscolor to create a color picker that also saves recent color choices to the palette. So I need the palette to be updated dynamically upon changing… I feel like this would be a common ask, but I am not seeing anything to do this… Any help would be appreciated!

jscolor docs page here: https://jscolor.com/docs/

let customColors =  [
        '#2C2B2B', '#FFEE92', '#17C3B2', '#71A5DE', '#C27EC2', '#FE6D73',
    ];

jscolor.presets.default = {
    position: 'right',
    palette: customColors,
    //paletteCols: 12,
    hideOnPaletteClick: true,
};
const colorPicker = document.getElementById('color-picker');
colorPicker.addEventListener('input', () => {
        customColors.push(colorPicker.value);
        
        //somehow update the palette here........
});

I tried messing with presets and using jscolor.install(); but was unable to get the palette to update.

How to check if an element is a clone or not html/js

If I have a clone of an element and the real version of the element, how can I check whether one is the real version or a clone? Example below:
HTML

<div id = "example">yay! I'm a random element</div>

JS

let real = document.getElementById("example");
let clone = real.cloneNode(true);
// It's obvious that the "real" variable is the real one,
// and "clone" is the clone, but I just need a way to check.
if (clone.methodToCheckIfItsAClone) {
    alert("clone");
} else {
    alert("not clone");
}

Is there a method or at least any way for me to check if the element is a clone?

How to querySelector from another HTML file other than ‘document’?

This code:

 const mobileNavShow = document.querySelector('.mobile-nav-show');

only looks through the index.html of my project, while my navbar is in navbar.html and is out of the scope of querySelector. I used w3’s w3-include-html to link the two. If I copy the contents of navbar.html into the body of index.html, my navbar works as intended. I am unsure of the technical terms of the problem I am facing.

I tried to create a navbar in a separate HTML file, but js “document.querySelector(‘X’)” is unable to find elements in the other HTML file.

MutationObserver does not trigger when I use the network tab to throttle speed to slow 3G

Context: I want to delay loading of non-essential scripts until a dynamically created hero image has loaded.

"use strict";

import { siteNavHandler } from "./siteNavHandler.min.js";
import { buildHeroGallery } from "./buildHeroGallery2.min.js";
import { pageNavHandlerList } from "./pageNavList.min.js";
import { lazyLoadingCtaSection } from "./lazyLoadingCtaSection.min.js";

document.addEventListener("DOMContentLoaded", init, false);
function init() {
  siteNavHandler();
  DelayScriptLoading();
  buildHeroGallery(); <----- This module loads the dynamic hero image
  pageNavHandlerList();
  lazyLoadingCtaSection();
}

function DelayScriptLoading() {
  const interval = setInterval(function () {
    if (document.querySelector("#heroImage0")) {
      console.log("Found! with polling");
      const img = document.querySelector("#heroImage0");
      img.addEventListener("onload", loadjs("polling event listener on load", img));
      clearInterval(interval);
    }
  }, 500);

  const target = document.getElementById("top");
  console.dir(target);

  function addHandler(records, observer) {
    for (const record of records) {
      for (const addedNode of record.addedNodes) {
        if (addedNode.id == "heroImage0") {
          console.log("MutationObserver triggered for " + `${addedNode.id}`);
          const img = addedNode.querySelector(".hero-gallery-img");
          img.addEventListener("onload", loadjs("MutationObserver event listener on load", img));
        }
        observer.disconnect();
      }
    }
  }

  const observerOptions = {
    childList: true,
    subtree: true,
  };

  const observer = new MutationObserver(addHandler);
  observer.observe(target, observerOptions);

  async function loadjs(param, img) {
    console.log("img has loaded and load JS function triggered using " + `${param}`);
    console.dir(img);
  }
}

However if I use chrome browser dev tools network throttling set to slow 3G the MutationObserver does not trigger but the polling interval does. When I set the throttling to fast 3G both the polling and Mutation observer trigger. What am I missing here that the Mutation observer does not work for slow 3G?

Console output with throttling set to slow 3G

controllerList.js:28 section#top.heroGalleryContainer
controllerList.js:20 Found! with polling
controllerList.js:52 img has loaded and load JS function triggered using polling event listener on load
controllerList.js:53 img#heroImage0.hero-gallery-img

console output with throttling set to fast 3G or higher

controllerList.js:28 section#top.heroGalleryContainer
controllerList.js:34 MutationObserver triggered for heroImage0
controllerList.js:52 img has loaded and load JS function triggered using MutationObserver event listener on load
controllerList.js:53 img.hero-gallery-img
controllerList.js:20 Found! with polling
controllerList.js:52 img has loaded and load JS function triggered using polling event listener on load
controllerList.js:53 div#heroImage0.hero-gallery-div.img--FadeIn

using script defer will not work because I want the scripts to load AFTER the dynamic hero image. Equally, async loading the scripts is not viable because I do not want them running in the background chewing up bandwidth UNTIL the hero image has loaded.

how to display an element of an x-for in a div in alpinejs

For example, I want to dynamically show that clicking on any for element updates the display dynamically. How could this be achieved? In alpinejs

<div x-data="{products: [{title: 'test01', subtitle: 'lorem lorem lorem', tags: [{title: 'tag01'},{title: 'tag02'}]}, {title: 'test02', subtitle: 'lorem lorem lorem', tags: [{title: 'tag03'},{title: 'tag04'}]}], option: 0}">

<div class="view_dinamic_content">
<span class="view_title"></span>
<p class="view_description"></p>
<ul class="view_tags">
<li>
</li>
</ul>
</div>


<ul>
<template x-for="(product, index) in products" :key="index">
     <li x-text="product.title" @click="option = index">
     </li>
</template>
</ul>

</div>

any explanation of this please

Is there a way to get the value of a player’s selected inventory slot in Minecraft?

I am creating an ADDON in Minecraft bedrock version.

I want to get the value of the slot that the player has selected.

I know how to get the player’s container from this article and how to scan the player’s inventory.

But it did not describe how to get the slot that the player has selected.
(“selected” in this case is the item in the player’s hand)

If you are familiar with addon creation, please help me if you can.

Thank you.

import { world, Player, EntityInventoryComponent } from "@minecraft/server";

world.getPlayers().forEach((player) => {
  let inventory = player.getComponent("inventory") as EntityInventoryComponent;
}

In angular 17 how to add facebook page-plugin

I have built an application in angular 17 and want to add a public facebook page in one of the component. I am able to load the facebook page in component however, it is not working properly.

Below is the code that i have implemented to add FB page in my app:

  • From https://developers.facebook.com/docs/plugins/page-plugin/ generated the code to embed page in my website.

  • Added following script in index.html:

    <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v19.0&appId=36553205380XXXX" nonce="XXXXX"></script>
    
  • Added following html to include FB page in component:

<div class="fb-page" data-href="https://www.facebook.com/facebook"
 data-tabs="timeline" data-width="" data-height="700" data-small-header="false" data-adapt-container-width="true"
 data-hide-cover="false" data-show-facepile="true"><blockquote cite="https://www.facebook.com/crossfit"
                                                               class="fb-xfbml-parse-ignore">
                                                               
  • Added following code in component
      ngOnInit() {
        if(FB.XFBML != null) {
          FB.XFBML.parse()
        }
      }

FB page got loaded in component but i am getting errors like below in console and it’s not loading new posts when i am scrolling down. Instead it’s repeating the posts from top.

Could not find element "u_1_50_IH" [Caught in: Module "__elem_6d29ee41_1_4_a2"] [Caught in: Module "__inst_6d29ee41_1_4_nL"] [Caught in: Module "__inst_a648e52c_1_8_OO"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_a176866d_1_4_XK"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_8c33f2cf_1_4_3G"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_492d06b7_1_4_oY"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_98d9a45e_1_8_OE"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_21a8c1d4_1_4_g+"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_866f970e_1_4_1G"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_c523de71_1_4_ef"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_1516ab8a_1_4_sJ"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_74f26af1_1_4_G9"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_9f6501f1_1_4_Xq"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_e698bc89_1_4_lH"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_70689822_1_4_p4"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_70dbca80_1_8_6O"] [Caught in: Requiring module "__inst_a648e52c_1_8_OO" which threw an exception] [Caught in: Module "__inst_57d19858_1_4_Rl"] [Caught in: Requiring module "__inst_6d29ee41_1_4_nL" which threw an exception]

– Also, when i am clicking on any post it opens FB in separate tab. It doesn’t allow to add comment or like from website itself opposite to FB documentation “The Page plugin lets you easily embed and promote any public Facebook Page on your website. Just like on Facebook, your visitors can like and share the Page without leaving your site. “

Is it because FB script not loading in angular properly. I have event tried using some modules for FB but none was compatible with angular17. Any help would be appreciated.

How to connect backend node.js code to mysql database through aws

I am tasked with hosting a website for a class. I need to run client, webserver, and database from three separate nodes as a requirement of the class. I have setup an aws instance and connected it to my vs code through ssh. The issue I am having is when I run node backend.js to establish the connection to the MySQL database it fails one way or another. I am stuck and not sure where to go from here, so any help is appreciated.

I wasn’t expecting this much trouble establishing a connection.


    [ec2-user@ip-172-31-19-97 ~]$ node backend.js
    Server listening on port 3000
    Error connecting to MySQL database: Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
        at Sequence._packetToError (/home/ec2-user/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
        at Handshake.ErrorPacket (/home/ec2-user/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
        at Protocol._parsePacket (/home/ec2-user/node_modules/mysql/lib/protocol/Protocol.js:291:23)
        at Parser._parsePacket (/home/ec2-user/node_modules/mysql/lib/protocol/Parser.js:433:10)
        at Parser.write (/home/ec2-user/node_modules/mysql/lib/protocol/Parser.js:43:10)
        at Protocol.write (/home/ec2-user/node_modules/mysql/lib/protocol/Protocol.js:38:16)
        at Socket.<anonymous> (/home/ec2-user/node_modules/mysql/lib/Connection.js:88:28)
        at Socket.<anonymous> (/home/ec2-user/node_modules/mysql/lib/Connection.js:526:10)
        at Socket.emit (node:events:517:28)
        at addChunk (node:internal/streams/readable:335:12)
        --------------------
        at Protocol._enqueue (/home/ec2-user/node_modules/mysql/lib/protocol/Protocol.js:144:48)
        at Protocol.handshake (/home/ec2-user/node_modules/mysql/lib/protocol/Protocol.js:51:23)
        at Connection.connect (/home/ec2-user/node_modules/mysql/lib/Connection.js:116:18)
        at Object.<anonymous> (/home/ec2-user/backend.js:17:12)
        at Module._compile (node:internal/modules/cjs/loader:1256:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
        at Module.load (node:internal/modules/cjs/loader:1119:32)
        at Module._load (node:internal/modules/cjs/loader:960:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
        at node:internal/main/run_main_module:23:47 {
      code: 'ER_NOT_SUPPORTED_AUTH_MODE',
      errno: 1251,
      sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client',
      sqlState: '08004',
      fatal: true
    }

Backend code

 // Import required modules
const express = require('express');
const mysql = require('mysql');

// Create Express application
const app = express();

// Configure MySQL connection
const connection = mysql.createConnection({
  host: '18.221.56.114', // Replace with your RDS endpoint
  user: 'Placeholder',
  password: 'Placeholder',
  database: 'file_sharing_db'
});

// Connect to MySQL database
connection.connect((err) => {
  if (err) {
    console.error('Error connecting to MySQL database:', err);
    return;
  }
  console.log('Connected to MySQL database');
});

// Define routes

// Route to fetch all users
app.get('/users', (req, res) => {
  connection.query('SELECT * FROM users', (err, results) => {
    if (err) {
      console.error('Error querying users:', err);
      res.status(500).json({ error: 'Internal server error' });
      return;
    }
    res.json(results);
  });
});

// Route to create a new user
app.post('/users', (req, res) => {
  const { username, password, email } = req.body;
  connection.query('INSERT INTO users (username, password, email) VALUES (?, ?, ?)', [username, password, email], (err, result) => {
    if (err) {
      console.error('Error creating user:', err);
      res.status(500).json({ error: 'Internal server error' });
      return;
    }
    res.status(201).json({ message: 'User created successfully', userId: result.insertId });
  });
});

// Start the server
const port = process.env.PORT || 3000;
app.listen(port, () => {
  console.log(`Server listening on port ${port}`);
});

Override React Component with CSS Style

so now I have a NavBar component.

I have this javascript code that lets the navbar have background color when it reaches 50px. How can I apply this javascript to only one file and not all.

I mean I want this scroll effect to only apply in homepage not in aboutPage or any other.

  const [sticky, setSticky] = useState(false);
  useEffect(() => {
    window.addEventListener("scroll", () => {
      window.scrollY > 50 ? setSticky(true) : setSticky(false);
    });
  }, []);


  return (
    <nav className={`container ${sticky ? "dark-nav" : ""}`}>
      <Link to="/">
        <img src={Logo} className="Logo" alt="" />
      </Link>
      <ul className={mobileMenu ? "" : "hide-mobile-menu"}>
        <li>
          <NavLink to="/">Home</NavLink>
        </li>
        <li>
          <NavLink to="/About">About</NavLink>
        </li>
        <li>
          <NavLink to="/Services">Services</NavLink>
        </li>
        <li>
          <NavLink to="/Contact">
            <btn className="btn">Contact Us</btn>
          </NavLink>
        </li>
      </ul>
      <img src={menuIcon} alt="" className="menu-icon" onClick={toggleMenu} />
    </nav>
  );

VS Code auto-completion not working with JavaScript/TypeScript for installed modules

See the image for an example of what I mean:

screenshot

In this image, I am using ‘mongoose’ and I expect to find Schema Properties such as required, immutable, validator, etc. This happens with most modules installed and used within VS Code. Is there a better option without having to write my own types for each declaration I do?

Versions:

I have been searching around Stack Overflow and various other search results, but most of them are from years ago and things have changed. Mongoose, now puts their types within their own package, not @types, but I am unsure if that’s even the problem since I have issues with ‘express’ type completions as well.

I have reverted VS Code to default settings and removed every extension without any success. I switched to using TypeScript without success.

Error : R3InjectorError -> InjectionToken angularfire2.app.options

R3InjectorError(Standalone[_ProfilePageComponent])[_AngularFireStorage -> InjectionToken angularfire2.app.options -> InjectionToken angularfire2.app.options -> InjectionToken angularfire2.app.options

Hi I’m building an Angular App and wanted to uitilize Firebase’s storage. I am running into an error when trying to inject AngularFireStorage inside my component. I am using Angular17 and firebase 10.11.0. Below is my code

core.mjs:11809 ERROR NullInjectorError: R3InjectorError(Standalone[_ProfilePageComponent])[_AngularFireStorage -> InjectionToken angularfire2.app.options -> InjectionToken angularfire2.app.options -> InjectionToken angularfire2.app.options -> InjectionToken angularfire2.app.options]: 

NullInjectorError: No provider for InjectionToken angularfire2.app.options!

My app.config.ts file

import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
import { provideClientHydration } from '@angular/platform-browser';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideFirebaseApp } from '@angular/fire/app';
import { provideAuth } from '@angular/fire/auth';
import { provideFirestore } from '@angular/fire/firestore';
import { provideStorage } from '@angular/fire/storage';
import { provideHttpClient } from '@angular/common/http';
import { app, auth, storage } from './firebase.config';
import { getFirestore } from 'firebase/firestore';
import { HttpClientModule } from '@angular/common/http';

// `appConfig.ts` with providers for the Firebase app and services
export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    provideClientHydration(),
    provideHttpClient(),
    provideAnimations(),
    importProvidersFrom([
      provideFirebaseApp(() => app),
      provideAuth(() => auth),
      provideFirestore(() => getFirestore(app)),
      provideStorage(() => storage),
    ]),
  ],
};

My firebase.config.ts file. I X’d the config information.

import { initializeApp } from 'firebase/app';
import { getAnalytics } from 'firebase/analytics';
import { getAuth } from 'firebase/auth';
import 'firebase/auth';
import 'firebase/database';
import 'firebase/storage';
import { getStorage } from 'firebase/storage';


export const firebaseConfig = {
  apiKey: 'X',
  authDomain: 'X',
  projectId: 'X',
  storageBucket: 'X',
  messagingSenderId: 'X',
  appId: 'X',
  measurementId: 'X',
};



export const app = initializeApp(firebaseConfig);

export const auth = getAuth(app);
export const storage = getStorage(app);

My component where I want to use Firebase Storage

import { AngularFireStorage } from '@angular/fire/compat/storage';
// import { AngularFireStorage } from '@angular/fire/storage';

// left out other parts of code that is irrelevant to this problem.

@Component({
  selector: 'app-driver-profile',
  standalone: true,
  imports: [
    CommonModule,
    FormsModule,
  ],

  templateUrl: './driver-profile.component.html',
  styleUrl: './driver-profile.component.css',
})
export class DriverProfileComponent implements OnInit {
  constructor(
    private storage: AngularFireStorage,
    private cdr: ChangeDetectorRef
  ) {}

Everytime i render this component, I get the exact same error to appear.

I’ve tried looking at other older forums post. Some of the posts said to use try injecting FirebaseStorage module, FirebaseModule, etc which didnt work.

I’ve tried changing import providers to the following below

 importProvidersFrom([
      provideFirebaseApp(() => initializeApp(environment.firebaseConfig)),
      provideAuth(() => getAuth()),
      provideFirestore(() => getFirestore()),
      provideStorage(() => getStorage())
    ]),

and well as initializing the firebase app in my firebase.config.ts (what i have now)

I’ve tried importing AngularFireStorage from @angular/fire/storage, yet everytime i tried doing it I would get,
“angular/fire/storage” has no export named “AngularFireStorage.

so that led me to use {AngularFireStorage} from ‘@angular/fire/compat/storage’.

I was thinking once i was able to get the providers in my App.config.ts, that I would be able to use the storage in the component I want. I was able to get the Firebase authentication to work.

At this point, i’m really lost on what to do next. Any guidance would be greatly appreciated! Thank you in advance!