简体   繁体   English

为什么在使用 ES 模块语法导入解构 flatten-js 库的默认导出时得到 TS2614 而在 const-destructure 时却没有?

[英]Why do I get a TS2614 when import-destructure the default export of flatten-js library using ES module syntax but not when const-destructure it?

I wish to improve the developer experience of the flatten-js library by fixing an issue I encountered with it.我希望通过解决我遇到的问题来改善flatten-js库的开发人员体验。

When I do当我做

import { point } from '@flatten-js/core';

I get a TS error that point doesn't exist but if I do我收到一个 TS 错误,指出该点不存在,但如果我这样做

import Flatten from "@flatten-js/core";
const { point } = Flatten;

then point is recognized as a member of the library.然后点被识别为图书馆的成员。 I've documented the issue here .我在这里记录了这个问题。 Anyone know what might be going on?有人知道会发生什么吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TS2614:模块没有导出成员“NextHandleFunction” - TS2614: Module has no exported member 'NextHandleFunction' Vue 3 + TypeScript TS2614:模块 &#39;&quot;*.vue&quot;&#39; 没有导出成员 - Vue 3 + TypeScript TS2614: Module '"*.vue"' has no exported member Vue组件导入接口时如何避免TS2614错误 - How to avoid TS2614 error when importing interfaces from Vue components 尝试使用 multer 在 fastify ts 中解构时出错 - Error when trying to destructure in fastify ts with multer TS中的结构 - Destructure in TS 在打字稿中,如何使用es6语法通过默认导出导入纯JavaScript文件? - In typescript, how can I import a plain javascript file with a default export using es6 syntax? 为什么我需要做 export const useAppDispatch = () =&gt; useDispatch<appdispatch> () 将 Typescript 与 React 一起使用时</appdispatch> - Why do I need to do export const useAppDispatch = () => useDispatch<AppDispatch>() when using Typescript with React Typescript:解构整个道具 object 并使用 ES6 提供默认值 - Typescript: destructure entire props object and provide default values using ES6 在js文件中导入默认导出ts文件 - Import default export ts file in a js file 此模块使用“export =”声明,并且只能在使用“esModuleInterop”标志时与默认导入一起使用 - This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM