Skip to content

Import fix creates incorrect URL for symbols from preact/hooks #37542

Closed
@cmlenz

Description

@cmlenz

TypeScript Version: 3.8.3

Search Terms:
import preact/hooks preact/hooks/src

Code

import {h} from 'preact';

function App(): void {
  const value = useMemo(() => 'Hello');
  return <div>{state}</div>;
}

Run missing import fix on useMemo.

Expected behavior:

The quick fix should add the import line

import {useMemo} from 'preact/hooks';

Actual behavior:

The quick fix actually adds the incorrect import line

import {useMemo} from 'preact/hooks/src';

This will cause the source files from Preact to be bundled instead of the transpiled files, which will cause various kinds of breakage (see preactjs/preact#1757 or preactjs/preact#1373).

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions