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

Error 'Target ""Default"" is not defined.' - but the target is there #2107

Closed
mapfel opened this issue Sep 25, 2018 · 11 comments
Closed

Error 'Target ""Default"" is not defined.' - but the target is there #2107

mapfel opened this issue Sep 25, 2018 · 11 comments

Comments

@mapfel
Copy link

mapfel commented Sep 25, 2018

Description

followed tutorial "GETTING STARTED WITH FAKE - F# MAKE"
https://fake.build/fake-gettingstarted.html

after pasting the 2nd code block of "CLEANING THE LAST BUILD OUTPUT"
https://fake.build/fake-gettingstarted.html#Cleaning-the-last-build-output

I get the error

The last restore is still up to date. Nothing left to do.
run "Default"
Building project with version: LocalBuild
The following targets are available:
Clean
Default
Target ""Default"" is not defined. Existing targets:

  • Clean
  • Default
    Script reported an error:
    -> Target ""Default"" is not defined.

Related information

  • Operating system: Win 10 Pro DE
  • Version of FAKE (4.X, 5.X): 5.7.0 and 5.7.2 tested
@BlythMeister
Copy link
Contributor

Can you please provide the command you use to call fake?

@mapfel
Copy link
Author

mapfel commented Sep 26, 2018

fake run build.fsx
fake build

both end up with the same messages

@matthid
Copy link
Member

matthid commented Sep 26, 2018

@mapfel Can you please upload your script file you wrote?

@mapfel
Copy link
Author

mapfel commented Sep 26, 2018

it is exactly that one from the tutorial
https://fake.build/fake-gettingstarted.html

@matthid
Copy link
Member

matthid commented Sep 26, 2018

No I think something is different (maybe whitespace?). Can you please zip and upload the folder because something is different. Also the full fake output might be helpful. For me it looks like this:
image

@matthid
Copy link
Member

matthid commented Sep 26, 2018

@mapfel From your output it looks like some quotes got added in your setup/environment . Did you add some environment variables?

@mapfel
Copy link
Author

mapfel commented Sep 26, 2018

attached a zip, including the fake scripts, my environment and the output
fake.2107.zip

@mapfel
Copy link
Author

mapfel commented Sep 26, 2018

your are right: it was the TARGET variable in my environment!
deleting it, and now I have a "green" output
wtf! strange
thanks guys for your efforts!!

@mapfel mapfel closed this as completed Sep 26, 2018
@matthid
Copy link
Member

matthid commented Sep 26, 2018

@mapfel Yes sadly that is an historic artifact and still there because of backwards compat... Maybe we should warn if it is used.

@matthid matthid reopened this Sep 26, 2018
@mapfel
Copy link
Author

mapfel commented Sep 26, 2018

Yes, in case somebody tries to upgrade like me, he will run into the same situation. It was a very frustrating experience not to be able to run the Getting Started sample.
So FAKE should check the existence of that variable and display a meaningful warning. Would be nice.

@matthid
Copy link
Member

matthid commented Sep 27, 2018

@mapfel Thanks for reporting, next version fake will tell when it uses the target environment variable.
Note that when looking thought the code I noticed that cli arguments are preferred so fake build --target Default should have worked as well.

This was referenced Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants