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

1

7

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.

Anastomosis answered 13/10, 2020 at 21:52 Comment(1)
I'm facing the precise same error... :/ And find it quite cryptic. Have you found the root cause and / or a fix?Carder
F
1

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

Flagstone answered 9/6, 2021 at 18:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.