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

Typescript imports have wrong file extension #3973

Open
dburriss opened this issue Dec 10, 2024 · 1 comment
Open

Typescript imports have wrong file extension #3973

dburriss opened this issue Dec 10, 2024 · 1 comment

Comments

@dburriss
Copy link

Description

When running fable the generated TS files link to JS files that do not exist.

Repro code

https://github.com/dburriss/haya-net/tree/typescript-support/src/Haya.Deno

Note: The deno project is referencing files in another project. Was hoping there was a better way to do this but could not think of anything.

Expected and actual results

When running:

dotnet fable --outDir ./ --lang ts

The generated .ts files contain imports like the following:

import { toString, Record, Union } from "../fable_modules/fable-library-ts.4.24.0/Types.js";
import { bool_type, record_type, string_type, union_type, TypeInfo } from "../fable_modules/fable-library-ts.4.24.0/Reflection.js";
import { IComparable, IEquatable } from "../fable_modules/fable-library-ts.4.24.0/Util.js";
import { StringBuilder__AppendLine, StringBuilder__AppendLine_Z721C83C5, StringBuilder__Append_Z721C83C5, StringBuilder_$ctor_Z721C83C5, StringBuilder_$ctor } from "../fable_modules/fable-library-ts.4.24.0/System.Text.js";
import { FSharpList, fold } from "../fable_modules/fable-library-ts.4.24.0/List.js";

The file ../fable_modules/fable-library-ts.4.24.0/Types.js does not exist though, instead ../fable_modules/fable-library-ts.4.24.0/Types.ts exists (which is what I expect). So the imports are generated expecting .js, when they should be expecting .ts.

Related information

  • Fable version: 4.24.0 (was happening on 4.22.0 too)
  • Operating system: OSX
@MangelMaxime
Copy link
Member

Similar to #3686 (comment)

To allow people consuming Fable => TS with runtimes like Deno we will need to add a new compiler flag.

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