"Element is not exported" error on ES6 class member

Hi,

Having the following ES6 class:

class A {
constructor(logger) {
this.logger = logger;
}

foo() {
this.logger.log('')
}
}

module.exports = A;

I get inspection error on "this.logger" saying: "Element is not exported" - why is that? it should not be exported as it is "private" member of the class.

WebStorm version:

WebStorm 2016.3.1
Build #WS-163.7743.51, built on November 22, 2016
JRE: 1.8.0_112-release-408-b2 x86
JVM: OpenJDK Server VM by JetBrains s.r.o

Thx.

0
3 comments

can't recreate in 2016.3.2 using provided example:

please can you try upgrading?

0
Avatar
Permanently deleted user

Upgraded, still happens.

This is the project I am using:

https://expirebox.com/download/21d0f648d7a96006ad304786c7f76b50.html

 

Basically I have 2 files (also Javascript is set to ECMAScrip6 and Node is enabled for the project).

a.js

class A {
constructor(logger) {
this.logger = logger;
}

foo() {
this.logger.log('');
}
}

module.exports = A;

 

b.js

var logger = {};
module.exports = logger;

 

 

 

 

 

 

 

 

 

 

0

Please sign in to leave a comment.