Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot understand what targets to deploy error #1106

Closed
kyleabens opened this issue Jan 14, 2019 · 3 comments
Closed

Cannot understand what targets to deploy error #1106

kyleabens opened this issue Jan 14, 2019 · 3 comments

Comments

@kyleabens
Copy link

kyleabens commented Jan 14, 2019

Version info

6.2.2

Platform Information

OSX

Steps to reproduce

$ firebase init

Select configuration for both functions and hosting. Then typescript and yes to TSLint.

Copy paste below into functions/src/index.ts:

import * as functions from 'firebase-functions';

import * as admin from 'firebase-admin';
admin.initializeApp();

// Most basic HTTP Funtion
export const basicHTTP = functions.https.onRequest((request, response) => {
  const name = request.query.name;

  if (!name) {
    response.status(400).send('ERROR you must supply a name :(');
  }

  response.send(`hello ${name}`);
});

$ firebase deploy --only functions

Expected behavior

I expect the function to be deployed successfully to the selected firebase project.

Actual behavior

I receive this error: "Cannot understand what targets to deploy. Check that you specified valid targets if you used the --only or --except flag. Otherwise, check your firebase.json to ensure that your project is initialized for the desired features."

@kyleabens kyleabens changed the title Cannot understand what targets to deploy Cannot understand what targets to deploy error Jan 14, 2019
@kyleabens
Copy link
Author

I got around that but now I receive this when I try to deploy:

../node_modules/@types/cordova/index.d.ts(35,58): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(36,52): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(37,53): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(38,57): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(39,57): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(40,59): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(41,62): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(42,60): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(43,63): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(44,61): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(46,61): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(47,55): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(48,56): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(49,60): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(50,60): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(51,62): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(52,65): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(53,63): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(54,66): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(55,64): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(57,51): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(58,54): error TS2304: Cannot find name 'Event'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Could this have something to do with TSLint?

@kyleabens
Copy link
Author

I added

"files": [
    "node_modules/typescript/lib/lib.es6.d.ts"
],
"exclude": [
    "node_modules"
]

to my tsconfig file in functions and that seemed to do the trick. Let me know if thats okay.

@mbleigh
Copy link
Contributor

mbleigh commented Jan 14, 2019

I don't see why that would be a problem. Glad you were able to solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants