4000-520-616
欢迎来到免疫在线!(蚂蚁淘生物旗下平台)  请登录 |  免费注册 |  询价篮
主营:原厂直采,平行进口,授权代理(蚂蚁淘为您服务)
咨询热线电话
4000-520-616
当前位置: 首页 > 新闻动态 >
新闻详情
Wrong Imports in Generated `.d.ts` on Windows-CSDN问答
来自 : CSDN技术社区 发布时间:2021-03-25

私信 访问主页

\"weixin_39937635\" weixin_39937635 2020-12-02 04:01 首页 开源项目 Wrong Imports in Generated `.d.ts` on Windows

As the picture shown, the generated file index.esm.d.ts contains OS-specific path imports:

\"image\"

More importantly, Suggestion interface is redefined...

该提问来源于开源项目 wessberg/rollup-plugin-ts

点赞 写回答 收藏 复制链接分享 删除 再等等 结题 再想想 8条回答

私信 访问主页

\"weixin_39616379\" weixin_39616379 3月前

The issue has been fixed and released in v1.1.55. Thanks for reporting it!

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39616379\" weixin_39616379 3月前

I m investigating the issue, and the issue is related to a couple of things:

When comparing two paths or filenames, rollup-plugin-ts always assume that they follow POSIX. For example, there are strict equality checks between generated filenames for Rollup chunks, which use the path convention of the OS, and Typescript sourcefile filenames, which are normalized to POSIX by Typescript itself. This means that some comparisons fail that wouldn t on MacOS where everything is POSIX.

The path module is used heavily to normalize file paths. However, they aren t normalized to POSIX when generating new ImportDeclarations and ExportDeclarations which means that stuff like import {foo} from \\\\a\\\\b\\\\c can happen where you would expect import {foo} from ./a/b/c instead.

I m working on fixing these things and I m testing both on MacOS and Windows. I ll keep you posted.

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39752434\" weixin_39752434 3月前

I m on a Windows 10 box and I d like to offer my help, too, should you need some.

I just switched to rollup-plugin-ts to build my own plugin. For now, I m using a separate build step to generate the declaration file and I d rather have your plugin do all the dirty job in one step.

I ve tried taking a look at your source code but it s dense and hard to follow when not used to. Just give some directions as to where to look in first.

edit: FWIW, using a bunch of console.log()s showed that when entering the deconflict() function in src\\service\\transformer\\declaration-bundler\\deconflict\\deconflict.ts, sourceFile.fileName is normalized while options.localModuleNames is not. Hope this helps.

\"Capture\"

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39937635\" weixin_39937635 3月前

Any help I can try? Not familiar with code but the plugin is awesome. It s better than the official one.

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39616379\" weixin_39616379 3月前

Yes there is, but grouped by emitted chunk, and since the import paths are broken, the logic for determining whether or not symbols are defined is broken on Windows

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39937635\" weixin_39937635 3月前

Is there any code determining whether a symbol is bundled or imported? As the picture shows, the Suggestion interface is declared twice.

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39616379\" weixin_39616379 3月前

Hi there, thanks for reporting this issue.I think this issue and https://github.com/wessberg/rollup-plugin-ts/issues/19 are related.

Looking at the image, the import paths look wrong, so I m certain that the issue is related to how relative paths are computed by the plugin.

I ll try to spin up a Windows VM and test it

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39937635\" weixin_39937635 3月前

It works fine under OS X (without the duplicated imports). Seems like a problem related to path.

点赞 评论 复制链接分享 提交 再想想 采纳 为你推荐 将Elasticsearch DSL转换为gopkg.in/olivere/elastic.v5 elasticsearch 1个回答Golang内置了docker和requirements.txt docker 1个回答GoImports杀死html语法高亮显示 vim 1个回答goimports无法与vim-go插件配合使用 vim 2个回答Golang构建错误:无法将* sqlx.DB分配给* sql.DB it技术互联网问答IT行业问题计算机技术编程语言问答 1个回答exec:“ gcc”:尝试执行构建时,在%PATH%中找不到可执行文件 cgowindowsbuild 9个回答仅在打开文件上使用Intellij File Watcher intellij-idea 2个回答golang测试错误:在以下任何位置都找不到软件包“ github.com/stretchr/testify/assert”: it技术互联网问答IT行业问题计算机技术编程语言问答 1个回答使用软件包“ golang.org/x/oauth2”对oauth2进行身份验证 oauth2 1个回答Golang代码组织又是否需要调用db.Close()? it技术互联网问答IT行业问题计算机技术编程语言问答 1个回答无法获取parser.ParseDir来解析导入语句 it技术互联网问答IT行业问题计算机技术编程语言问答 1个回答将pubsub与golang一起使用:ocgrpc.NewClientStatsHandler it技术互联网问答IT行业问题计算机技术编程语言问答 2个回答当我与docker compose一起使用go时出现“ No Go files in ...”错误 docker 1个回答play.golang.org如何自动管理导入? it技术互联网问答IT行业问题计算机技术编程语言问答 1个回答不带导入功能的`go run * .go`文件如何访问功能? it技术互联网问答IT行业问题计算机技术编程语言问答 1个回答在Sublime Text中保存运行goimports吗? sublimetext3 3个回答Golang:无法安装软件包zvelo / ttlru package 2个回答错误:标准软件包中的非标准导入“ gopkg.in/yaml.v2” yaml 1个回答在GoLang中保存运行“ goimports” it技术互联网问答IT行业问题计算机技术编程语言问答 3个回答goimports需要忽略供应商软件包 it技术互联网问答IT行业问题计算机技术编程语言问答 2个回答 点击登录 提问题 欢迎建议意见 . 如何写高质量提问和回答? 采纳榜7天 被采纳次数 ProfSnail 21 coagenth 16 幻灰龙 164 qq_34124780 145 Jack_Yang(数据分析及可视化) 126 规则边缘 117 GoCityPass新加坡曼谷通票 118 天际的海浪 99 cpp_learner 910 我不喜欢这个世界 9 加急问题 100 unity 设置Animation的culling type 导致游戏崩溃 75 数据库只有myd文件没有frm,myi文件,怎么打开呢 55 微服务框架,springboot启动异常 51 利用Adams联合matlab仿真求运动学反解问题 50 labview使用datasocket与c/c#程序的通信 50 已知地图GPS坐标点A和坐标点B,获取A点往B点直线走一定距离的坐标点经纬度? 50 在不import任何东西并且限制交换次数的情况下做HeapSort和MergeSort?

本文链接: http://bergimports.immuno-online.com/view-774236.html

发布于 : 2021-03-25 阅读(0)
公司介绍
品牌分类
其他
联络我们
服务热线:4000-520-616
(限工作日9:00-18:00)
QQ :1570468124
手机:18915418616
官网:http://