TypeError on production build with webpack
roboslone opened this issue · 4 comments
roboslone commented
When I build my project in dev mode with webpack everything works fine. But when I build in production mode (NODE_ENV=production webpack -p
), I get TypeError: Cannot convert a Symbol value to a string
.
To clarify, I'm converting symbol to a string using toString()
method.
wwayne commented
@roboslone How you use the es6-enum? can you give me some code samples?
roboslone commented
Somewhat like that:
import Enum from 'es6-enum'
export class MyClass {
static State = Enum(
'ONLINE',
'OFFLINE',
'UPDATING',
)
}
MyClass.State.ONLINE.toString()
wwayne commented
@roboslone I googled around but I still have no idea, for this lib, it should never return such error, someone got this error because of the framework restriction, no idea if it is related
roboslone commented
Well, we had to switch to enumify
and it fixed the issue. Not sure how, though.