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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With