Skip to content

[TS] Improve import of types to use import {type int32 } from ... syntax #4225

@Freymaurer

Description

@Freymaurer

I encountered this issue in a new react project i adjusted to use Feliz instead of native react code. As I was experimenting with typescript transpilation in fable I quickly encountered the issue for example in:

import { int32 } from "./fable_modules/fable-library-ts.5.0.0-alpha.14/Int32.js";

Which stopped the code from transpiling via vite in my case and i got the following error in the browser console:

Uncaught SyntaxError: The requested module '/src/fableoutput/fable_modules/fable-library-ts.5.0.0-alpha.14/Int32.ts' does not provide an export named 'int32'

By changing the transpiled output to use type int32 everything works fine.

import { type int32 } from "./fable_modules/fable-library-ts.5.0.0-alpha.14/Int32.js";

This should allow better compatibility for typescript bundling.

Note

For now i disabled "verbatimModuleSyntax": true, in my tsconfig.json, which also fixed the issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions