-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
TypeError: Cannot read property '_walk' of null #120
Comments
There is no actionable information here since you failed to fill out the issue template.
|
Try to generate a minimal code example which fails on terser |
+1, I also run into this problem, these other issues are related |
@alechirsch Without a standalone javascript example reproducing the problem nothing can be done. All the information outlined here is required: https://raw.githubusercontent.com/terser-js/terser/master/.github/ISSUE_TEMPLATE.md |
I'm attempting to track down where this issue may fall. It did not exist in |
To make a bug repro just provide the arguments passed to The easiest way to do that is to find the
then remove the bundle from its
then go to the --- a/lib/minify.js
+++ b/lib/minify.js
@@ -59,2 +59,4 @@ function to_json(cache) {
function minify(files, options) {
+ console.error("*** terser options:\n", options);
+ console.error("*** terser input:\n", files);
var warn_function = AST_Node.warn_function; and then run Then you can run your project's build command as normal. Paste the stderr output into a gist and drop the URL here in this ticket. |
Thanks, I've pasted the (huge) output into https://gist.github.com/jrjohnson/0a73a3f8588b5ced74f79530eda2a449 At the end it refers to a Stack Trace and Error Report and I put that at https://gist.github.com/jrjohnson/cf4cbcb9922d5f9a1286b41f1eaee079 |
@jrjohnson Unable to reproduce any error using
and the (cleaned up) source from https://gist.github.com/jrjohnson/0a73a3f8588b5ced74f79530eda2a449 Strangely, the gist link above mentions an "Invalid assignment" parse error, which is different than the "Cannot read property '_walk' of null" error reported in the top post. I was not able to reproduce either error. |
I'm sorry @kzc I think I may have been in a rush and gotten sloppy with my original output. I've replaced the content of both gists with a correct update that is failing with the Cannot read property '_walk' of null error. |
https://gist.github.com/jrjohnson/0a73a3f8588b5ced74f79530eda2a449/raw/2bce10e922162ec3dae635c5bd7c4b509303a4b0/output.text is corrupted.
...
You need to come up with a way to save the minify input in some other way - via |
It's possible that code is being minified in parallel by ember. If so, disable this option. |
Ok, I think I've fixed it up. Went with |
@jrjohnson That did the trick. Here's a reduced test case:
Expected:
Actual:
Recommended workaround: Set the
Note: This is not a recent bug. It is present in all versions of
Issue was introduced in 9b58b54. |
This is an interesting bug. It is caused by the interaction of the following
Disabling any of those What happens in the reduced test case is that the
I suspect that something in the |
@joshsearles Could you please change the title of this issue to the following?
|
UglifyWriter
plugin - _walk of null
updated @kzc |
A similar (but unrelated) past bug and its fix might inspire some ideas for this issue. |
@jrjohnson If you're wondering why this long-standing Terser bug just appeared in the last week, by coincidence this perfectly valid September 27th I suspect any other project using
|
I figured it must be a dependency chain issue. Either either terser's deps or in the fairly vast ember build ecosystem. Thanks for digging into it so far! I've implemented the |
Even more reduced test case: function foo(node) {
var traverse = function(obj) {
var i = obj.data;
return i && i.a != i.b;
};
while (traverse(node)) { }
} |
#120 (comment) is an |
Even more reduced test case: const foo = function () {
var t = function(o) {
var i = o.b;
i + i.a
};
while (t()) { }
} |
Since we're playing code golf, here's a failure involving
Above were Here's a variation involving
And another variation with
I'm not aware of a failing case that does not involve a loop. Although it would be easier to eliminate |
Fixed as of |
Thank you! |
This seems to have popped up again. I'm getting the following:
when using Terser |
getting same issue, using CRA2 "react": "^16.5.2", |
This is an issue when trying to build Ionic 4 production apps - receiving following error message: This happens when using using |
The best way to get started solving this is probably to open a new issue and follow the steps in the comments above to create a reduced test case. |
There is already an issue for |
Bug Report
terser v3.9.2
Building Ember js Project
EDIT:
to replicate on a basic ember js project (apparently it was the ember-cli-deploy plugin for me)
The text was updated successfully, but these errors were encountered: