Skip to content

getForeignBindings doesn't understand enum imports #74

Description

@tmm1

i have a tsx file roughly like:

import { ResultKind } from './kind.js'
...
resolvedCommand.kind === ResultKind.FOO

where kind.js is:

export const enum ResultKind {
	FOO,
	BAR,
}

the tsx gets translated to:

// no import of ResultKind in generated js
...
resolvedCommand.kind === 2 /* ResultKind.FOO */
...
    location: "App.tsx:186:7",
    signature: "b58d5153",
    dependencies: () => ({
...
        ResultKind,
        setTimeout,

resulting in an error:

ERR ResultKind is not defined: ReferenceError: ResultKind is not defined
    at Object.dependencies (http://localhost:5173/App.js?t=1736753306453:2814:9)
    at patchComponent (http://localhost:5173/node_modules/.vite/deps/solid-refresh.js?v=81f91454:108:89)
    at patchComponents (http://localhost:5173/node_modules/.vite/deps/solid-refresh.js?v=81f91454:130:9)
    at patchRegistry (http://localhost:5173/node_modules/.vite/deps/solid-refresh.js?v=81f91454:167:40)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions