question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error TS1036: Statements are not allowed in ambient contexts

See original GitHub issue

Hi,

I’m having an issue when i’m trying to start my nativescript project. It happens every time just after I add firebase plugin to my app.

Executing before-prepare hook from /home/flow/nativescript/real/t/app/ChallengeMeApp/hooks/before-prepare/nativescript-dev-typescript.js Found peer TypeScript 2.6.2 node_modules/nativescript-plugin-firebase/firebase.d.ts(699,1): error TS1036: Statements are not allowed in ambient contexts.

Here is my package.json

{ “description”: “NativeScript Application”, “license”: “SEE LICENSE IN <your-license-filename>”, “readme”: “NativeScript Application”, “repository”: “<fill-your-repository-here>”, “nativescript”: { “id”: “com.teeme.challengemeapp”, “tns-android”: { “version”: “3.4.2” } }, “scripts”: { “lint”: “tslint "app/**/*.ts"” }, “dependencies”: { " @ angular/animations": “~5.2.0”, " @ angular/common": “~5.2.0”, " @ angular/compiler": “~5.2.0”, " @ angular/core": “~5.2.0”, " @ angular/forms": “~5.2.0”, " @ angular/http": “~5.2.0”, " @ angular/platform-browser": “~5.2.0”, " @ angular/platform-browser-dynamic": “~5.2.0”, " @ angular/router": “~5.2.0”, “font-awesome”: “^4.7.0”, “nativescript-angular”: “^5.3.0”, “nativescript-camera”: “^4.0.2”, “nativescript-imagepicker”: “^6.0.1”, “nativescript-plugin-firebase”: “^5.2.0”, “nativescript-pulltorefresh”: “^2.1.0”, “nativescript-snackbar”: “^3.0.0”, “nativescript-theme-core”: “^1.0.4”, “nativescript-toast”: “^1.4.6”, “nativescript-ui-listview”: “^3.5.4”, “reflect-metadata”: “~0.1.10”, “rxjs”: “~5.5.5”, “tns-core-modules”: “^4.0.0”, “zone.js”: “~0.8.18” }, “devDependencies”: { “@angular/compiler-cli”: “~5.2.0”, “@ngtools/webpack”: “~1.9.4”, “babel-traverse”: “6.26.0”, “babel-types”: “6.26.0”, “babylon”: “6.18.0”, “codelyzer”: “~4.0.2”, “copy-webpack-plugin”: “~4.3.0”, “css-loader”: “~0.28.7”, “extract-text-webpack-plugin”: “~3.0.2”, “lazy”: “1.0.11”, “nativescript-dev-sass”: “~1.3.5”, “nativescript-dev-typescript”: “~0.6.0”, “nativescript-dev-webpack”: “~0.9.1”, “nativescript-worker-loader”: “~0.8.1”, “raw-loader”: “~0.5.1”, “resolve-url-loader”: “~2.2.1”, “sass-loader”: “~6.0.6”, “tslint”: “~5.8.0”, “typescript”: “~2.6.2”, “uglifyjs-webpack-plugin”: “~1.1.6”, “webpack”: “~3.10.0”, “webpack-bundle-analyzer”: “^2.9.1”, “webpack-sources”: “~1.1.0” } }

I already did things like linking with firebase, init firebase when app starting…

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
EddyVerbruggencommented, Apr 26, 2018

Should be fine now.

1reaction
lambourncommented, Apr 26, 2018

@EddyVerbruggen hmm. I just tried it with WebStorm which I think uses the IntelliJ core and it works there as well (I am on macOS btw if that matters)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Statements are not allowed in ambient contexts - Stack Overflow
These two things combined together are the problem: I made a index.d.ts file. I am trying to assign a function to String.prototype.
Read more >
Microsoft/TypeScript - Gitter
... recieve the error TS1036: Statements are not allowed in ambient contexts . ... is like a header file except it can only...
Read more >
[SOLVED] An Implementation Cannot Be Declared in Ambient ...
Ambient declarations only exist in the type system and are erased at runtime, so they are not meant to contain implementations. The car...
Read more >
TypeScript errors and how to fix them
error TS1036: Statements are not allowed in ambient contexts. Broken Code ❌. 1 2 3 4 5
Read more >
Fix "An Implementation Cannot Be Declared in Ambient ...
A guide on how to fix the “an implementation cannot be declared in ambient contexts” error in TypeScript. ... Ambient declarations only exist...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found