close

[solved] ReferenceError: Cannot access ‘Player’ before initialization

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ReferenceError: Cannot access ‘Player’ before initialization in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How To Solve ReferenceError: Cannot access ‘Player’ before initialization Error ?

  1. How To Solve ReferenceError: Cannot access 'Player' before initialization Error?

    To Solve ReferenceError: Cannot access 'Player' before initialization Error I went to the Node.JS forums and asked what could be the issue. Not a babel issue at all, just circular dependencies. For example.

  2. ReferenceError: Cannot access 'Player' before initialization

    To Solve ReferenceError: Cannot access 'Player' before initialization Error I went to the Node.JS forums and asked what could be the issue. Not a babel issue at all, just circular dependencies. For example.

Solution 1

I went to the Node.JS forums and asked what could be the issue. Not a babel issue at all, just circular dependencies. For example:

// A.js
import B from './B.js'
export default class A{}
// B.js
import A from './A.js'
export default class B extends A{}

Sorry, there wasn’t nearly enough information to be able to figure this one out. I got a lot of help on the node.js GitHub and someone looked through my project on GitHub and ended up finding an instance where two modules pointed at each other.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment