fixed: ModuleInfo.importedIds will return null if resolvedIds[source] is undefined #4208
This PR contains:
Are tests included?
I get error (TypeError: Cannot read property 'id' of undefined) when use
after check importedIds source code, fin not compatible
The text was updated successfully, but these errors were encountered:
@@ 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
I'm back again~
I have this rollup config:
index.ts as below:
util.ts as below:
testPlugin as below:
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.