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: An implementation of file has already been given #781

Closed
et1975 opened this issue Mar 29, 2017 · 4 comments
Closed

Error: An implementation of file has already been given #781

et1975 opened this issue Mar 29, 2017 · 4 comments

Comments

@et1975
Copy link
Member

et1975 commented Mar 29, 2017

Description

Same file name across different project references causes the error:

Fable loader sent: fable-elmish/samples/react/navigation/app.fsproj
F# PROJECT: fable-elmish/samples/react/navigation/app.fsproj
   fable-elmish/samples/react/node_modules/fable-powerpack/src/Result.fs
   fable-elmish/samples/react/node_modules/fable-powerpack/src/Promise.fs
   fable-elmish/samples/react/node_modules/fable-powerpack/src/PromiseSeq/Type.fs
   fable-elmish/samples/react/node_modules/fable-powerpack/src/PromiseSeq/Module.fs
   fable-elmish/samples/react/node_modules/fable-powerpack/src/PromiseSeq/Extensions.fs
   fable-elmish/samples/react/node_modules/fable-powerpack/src/Fetch.fs
   fable-elmish/samples/react/node_modules/fable-powerpack/src/IndexedDB.fs
   fable-elmish/samples/react/node_modules/fable-react/Fable.Import.React.fs
   fable-elmish/samples/react/node_modules/fable-react/Fable.Helpers.React.fs
   fable-elmish/samples/react/node_modules/fable-elmish/prelude.fs
   fable-elmish/samples/react/node_modules/fable-elmish/cmd.fs
   fable-elmish/samples/react/node_modules/fable-elmish/program.fs
   fable-elmish/samples/react/node_modules/fable-elmish-react/common.fs
   fable-elmish/samples/react/node_modules/fable-elmish-react/react.fs
   fable-elmish/samples/react/node_modules/fable-elmish-react/react-native.fs
   fable-elmish/samples/react/node_modules/fable-elmish-browser/prelude.fs
   fable-elmish/samples/react/node_modules/fable-elmish-browser/parser.fs
   fable-elmish/samples/react/node_modules/fable-elmish-browser/navigation.fs
   fable-elmish/samples/react/node_modules/fable-elmish-debugger/Fable.Import.RemoteDev.fs
   fable-elmish/samples/react/node_modules/fable-elmish-debugger/debugger.fs
   fable-elmish/samples/react/navigation/app.fs
Parsing F# project...
F# project contains errors:
fable-elmish/samples/react/node_modules/fable-elmish-browser/prelude.fs(L4,0) : error FSHARP: An implementation of the file or module 'Prelude' has already been given

Repro code

in fable-elmish/samples/react:

yarn install
cd navigation
dotnet restore
dotnet fable npm-run start

Expected and actual results

Expect it to compile.

Related information

  • fable-compiler version: 1.0.0-narumi-907
  • fable-core version: 1.0.0-narumi-906
  • Operating system: OSX
@alfonsogarciacaro
Copy link
Member

No good, Fable is merging all files in a single project (that's the only way to get the full AST). We could try to avoid that or change the file names somehow, but it'd be a considerable amount of work. Ideally this should be fixed in the compiler, I'm taking shots in the dark here: dotnet/fsharp#2728

@alfonsogarciacaro
Copy link
Member

Original issue in F# compiler dotnet/fsharp#2679

MangelMaxime pushed a commit to elmish/elmish that referenced this issue Mar 30, 2017
@alfonsogarciacaro
Copy link
Member

A coup d'état attempt and @forki's help has been necessary to fix this, but it finally seems to be working now :)

@et1975 @MangelMaxime Could you please update to latest dotnet-fable (use dotnet restore --no-cache) and try again?

@MangelMaxime
Copy link
Member

Thanks @forki and @alfonsogarciacaro this solved the problem we were facing when using Elmish + elmish-browser-navigation 👏 👏 👏

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

3 participants