ITADN

v5.7.0: arrow function parameters parsed as exported declarations

#502OpenJonSpeare 创建于 2026-02-27
J
JonSpearecommented
scanExports in v5.7.0 incorrectly picks up arrow function parameters as named exports. This file (from @nuxt/ui): ```js export const useResizable = (key, options = {}, { collapsed = ref(false) } = {}) => { ... }; ``` ...causes `options` to be registered as an export alongside `useResizable`. At runtime: ``` SyntaxError: Importing binding name 'options' is not found. ``` The new comma-separated declaration parsing doesn't distinguish between: ```js export const a = 1, b = 2, c = 3 // a, b, c are all exports export const fn = (a, b = {}) => { ... } // only fn is an export ``` Works on 5.6.0, broken on 5.7.0.
7 条评论