-
-
Notifications
You must be signed in to change notification settings - Fork 470
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
Potential crash in removeStyleElement when sourcemaps are enabled #179
Comments
Happened to me and then I tracked down and found this issue. Being recently discovered, could this be a bad combination of webpack & webpack loader versions? Tried to downgrade but still no luck. |
@Kovensky 👋 Do maybe have a fix in mind ? 😛 See also #182 |
Nope, I still have no idea how this happens 😆 I just tried to debug the current state as of the crash, but I don't know what leads to the bad state. I ended up making a hack loader to delete the specific |
Could you link me to the code? But I have the slight feeling it will be complicated 🤣 |
@Kovensky can you create minimal test repo? It is speed up the solution of the problem 😄 |
If this is still relevant reopen anytime with a reproducible test repo (as simple as possible) :D |
Do you want to request a feature or report a bug?
Bug report
What is the current behavior?
TypeError: cannot read property 'removeChild' of null
in the linestyleElement.parentNode.removeChild(styleElement);
. ThestyleElement
exists, but its blob URL is not registered, and theparentNode
isnull
.Looking a few stack traces up, in the
addStylesToDom
call, the bad function call is the linedomStyle.parts[j](item.parts[j]);
. However, whiledomStyle.parts.length === 2
,item.parts.length === 1
; this seems to lead to the<link>
element being created whenj
is0
, and immediately destroyed whenj
is1
before it gets passed to theaddStyle
call that would attach to the DOM.If the current behavior is a bug, please provide the steps to reproduce.
I am not entirely sure on the steps needed yet, but it might be related the file being processed (
item.id
) being empty after going through loaders (nothing but stylus variable declarations). Alternatively, it is not going through loaders correctly due tocss-loader
'simportLoaders
hack.What is the expected behavior?
No crash.
Please mention other relevant information such as your webpack version, Node.js version and Operating System.
[email protected]
,[email protected]
,[email protected]
.The text was updated successfully, but these errors were encountered: