I am developing a project using laravel, so that means I'm using mix to compile javascript. I have syntax like
return this.page?.sidebar_text_color
When I run npm run dev or npm run watch, I get compilation error
Add @babel/plugin-proposal-optional-chaining (https://git.io/vb4Sk) to the 'plugins' section of your Babel config to enable transformation
The thing is, I have already set this up earlier and everything was working fine it just stopped working all of a sudden today. Here's my package.json fragment regarding babel
"babel": {
"plugins": [
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-class-properties"
]
}
As you can see, I have everything set up and yet still, npm is telling me to install that plugin for babel. What could be wrong?