New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed: ModuleInfo.importedIds will return null if resolvedIds[source] is undefined #4208
Conversation
moduleInfo.importedIds return null if resolvedIds[source] if undefined
Can you add a test case where this is wrong? This looks like there is a serious underlying mis-assumption that I would rather fix than hide the symptoms. |
Codecov Report
@@ Coverage Diff @@
## master #4208 +/- ##
=======================================
Coverage 98.37% 98.37%
=======================================
Files 202 202
Lines 7248 7259 +11
Branches 2118 2119 +1
=======================================
+ Hits 7130 7141 +11
Misses 58 58
Partials 60 60
Continue to review full report at Codecov.
|
I will add test case within whit weekend. |
I'm back again~ I have this rollup config:
index.ts as below:
util.ts as below:
testPlugin as below:
when use
and this will report error: so I made this pr in order to ignore(or fixed?) this problem. |
The original problem is caused by the fact that moduleParsed is called before all imports of the module have been resolved. Thus your solution would fix the symptom, but the actual ids would be incomplete, most likely an empty array. There are two possible ways to fix this:
I will push a fix for the latter to your branch. |
well, after review your commit that make |
This PR contains:
Are tests included?
Breaking Changes?
Description
I get error (TypeError: Cannot read property 'id' of undefined) when use
moduleInfo.importedIds
in moduleParsed of rollup pluginafter check importedIds source code, fin not compatible
undefined
.