GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Type cast in one line arrow function `() => ({} as Type)` cause vite:esbuild transform error · Issue #348 · vitejs/vite-plugin-react Closed Labels bug: upstreamBug in a dependency of Vite DescriptionDescribe the bugType cast in useMemo code: const v = useMemo( () => ({ name: 'random', age: count, } as RandomType), // type cast here will cause error [count] ); // if not cast to `RandomType` in `()` return , its ok const v2 = useMemo<RandomType>( () => ({ name: 'random', age: count, }), [count] ); error msg: similar code like below doesn't cause error in vanilla vite, but errors with this plugin const fakeMemo = (fn: any, dep: []) => fn(dep); const v3 = fakeMemo( () => ({ name: 'random', age: count, } as RandomType), [] ); Reproductionhttps://stackblitz.com/edit/vitejs-vite-l8ggg5?file=src%2FApp.tsx Steps to reproduceRun System InfoSystem:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@vitejs/plugin-react: ^4.3.1 => 4.3.1
vite: ^5.3.2 => 5.3.3Used Package Managernpm LogsNo response Validations
Activity
MetadataMetadataAssigneesLabelsbug: upstreamBug in a dependency of Vite TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |