Skip to content
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

Uncaught TypeError: Cannot read property 'dom' of undefined #8

Closed
slavikdenis opened this issue Jun 3, 2019 · 6 comments
Closed

Uncaught TypeError: Cannot read property 'dom' of undefined #8

slavikdenis opened this issue Jun 3, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@slavikdenis
Copy link

While trying to run npx visualize-bundle -a -d -o ./, I'm running into an issue on the generated html file Uncaught TypeError: Cannot read property 'dom' of undefined.

If you need any more details on this issue, please let me know. Thanks

image

@ticket-tagger ticket-tagger bot added the bug Something isn't working label Jun 3, 2019
@JonnyBurger
Copy link
Owner

Thanks for filing the issue!

Can you try to feed the result into https://www.npmjs.com/package/source-map-explorer directly and see if the this might be a bug in source-map-explorer?

Alternatively it could be the -o flag. Does the problem remain if you remove it?

@slavikdenis
Copy link
Author

slavikdenis commented Jun 4, 2019

Removing the -o flag does not help.


After saving the bundle from
http://localhost:8081/index.bundle?platform=android&sourceMap=true&dev=true&minify=false&hot=false
as bundle.js and the source map from
http://localhost:8081/index.map?platform=android&sourceMap=true&dev=true&minify=false&hot=false
as bundle.js.map ,
I had to edit the raw bundle last line from
//# sourceMappingURL=http://localhost:8081/index.map?platform=android&sourceMap=true&dev=true&minify=false&hot=false
to
//# sourceMappingURL=bundle.js.map.

After I ran npx source-map-explorer bundle.js{,.map} and only after these steps I successfully generated the report.

image

Not completely sure if these are the standard steps to succeed tho :D

JonnyBurger added a commit that referenced this issue Jun 5, 2019
@JonnyBurger
Copy link
Owner

Hi Denis!

Thanks that is very helpful!
While I do not experience the error, I have made a PR here: #9

Could you check out this PR and try to see if it works? You can start the tool locally just with npm install followed by npm start.

@slavikdenis
Copy link
Author

Unfortunatly the prepare script is failing for me probably because I'm on windows and
tsc && echo "#! /usr/bin/env node" | cat - dist/index.js > /tmp/out && mv /tmp/out dist/index.js
is not cross-platform.

I will look into the solution for windows later and let you know.

@slavikdenis
Copy link
Author

@JonnyBurger sorry for the delay. I just tried out your PR but unfortunately without success :/ Do not worry to close this issue and reopen it when someone else runs into this issue as well.

@JonnyBurger
Copy link
Owner

Thanks for getting back!
If somebody has more info please comment here 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants