fable-compiler / samples-electron

Fable bindings and samples for Github Electron
Apache License 2.0
60 stars 12 forks source link

Problems running `yarn start` under dotnet 2.1.300 #32

Open rmunn opened 6 years ago

rmunn commented 6 years ago

With the newly-released .Net Core SDK 2.1 (dotnet version reports 2.1.300), the handling of the current working directory has changed and dotnet foo now sets the CWD to the root of the project before running the foo command. What's currently in package.json is assuming that the CWD from which the command is run will be src/Main:

    "start": "cd src/Main && dotnet fable webpack --port free -- -w --config ../../webpack.config.js",

But if running with dotnet 2.1.300 or later, that needs to become:

    "start": "cd src/Main && dotnet fable webpack --port free -- -w --config webpack.config.js",

so that the webpack.config.js file will be found.

rmunn commented 6 years ago

See also https://github.com/dotnet/cli/issues/4473#issuecomment-256531057 and https://github.com/dotnet/project-system/pull/3073 — it may be possible to set the <RunWorkingDirectory> and/or <StartWorkingDirectory> properties in the .csproj file to change this behavior, in which case the package.json might not need to be changed. It's possible that doing this may allow the same configuration to work on older and newer dotnet versions, though I'm not able to test that right now.

MangelMaxime commented 6 years ago

I can't repro it...

Machine infos

alfonsogarciacaro commented 6 years ago

BTW, in Fable 2 the subprocess will always be run in the directory where package.json is found so hopefully there will be no more confusion :)