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

Comments

Projects
None yet
3 participants
@mapfel
Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2018

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

@mapfel

This comment has been minimized.

Copy link
Author

commented Sep 26, 2018

fake run build.fsx
fake build

both end up with the same messages

@matthid

This comment has been minimized.

Copy link
Collaborator

commented Sep 26, 2018

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

@mapfel

This comment has been minimized.

Copy link
Author

commented Sep 26, 2018

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

@matthid

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Author

commented Sep 26, 2018

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

@mapfel

This comment has been minimized.

Copy link
Author

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 Sep 26, 2018

@matthid

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Collaborator

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
You can’t perform that action at this time.