Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "TSModuleBlock"

I am upgrading the dependencies of my react-native application from 0.53 to 0.59. But I am facing the below error while trying to build it using ./gradlew assembleRelease.

@babel/template placeholder "$1": Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "TSModuleBlock". @babel/template placeholder "$1": Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "TSModuleBlock" at Object.validate (C:\vs-code-upgraded\node_modules@babel\types\lib\definitions\utils.js:132:11) at validateField (C:\vs-code-upgraded\node_modules@babel\types\lib\validators\validate.js:24:9) at validate (C:\vs-code-upgraded\node_modules@babel\types\lib\validators\validate.js:17:3) at builder (C:\vs-code-upgraded\node_modules@babel\types\lib\builders\builder.js:38:27) at Object.expressionStatement (C:\vs-code-upgraded\node_modules@babel\types\lib\builders\generated\index.js:316:31) at applyReplacement (C:\vs-code-upgraded\node_modules@babel\template\lib\populate.js:86:27)

I would like to know if there is possiblity to solve this build error. thank you in advance.

like image 304
Musie Avatar asked Oct 13 '20 21:10

Musie


1 Answers

This might probably due to a namespace being exported which only contain interfaces/types (Not actual classes/functions/objects but type declarations).

A quick fix is to add declare to the exported namespace.

export declare namespace SomeNameSpace

instead of

export namespace SomeNameSpace

like image 165
Ananthu Avatar answered Oct 18 '22 13:10

Ananthu