Code Monkey home page Code Monkey logo

Comments (4)

psequest avatar psequest commented on May 13, 2024

Same issue for me. Very simple to reproduce. I created a react project 'test-analyze-project' with create-react-app with no modification. I've followed the guide of create react app, so:
a°) npm install --save source-map-explorer
b°) In package.json, new line: "analyze": "source-map-explorer build/static/js/main.*",
c°) npm run build
d°) npm run analyze
FYI : "source-map-explorer": "^1.5.0" ( package.json )
I got the folowing logs :

Executing task: npm run analyze <
[email protected] analyze /home/pas/work/test-analyze-project
source-map-explorer --only-mapped build/static/js/main.*
Unable to map 42 / 123117 bytes (0.03%)
Then, the browser opens a generated html page whose "var tree={" ends by "": 42, }

I re-tried but with the --only-mapped option, the "Unable to map 42.." was not printed and the tree variable did not contains the ": 42 item.

Unfortuneltely, in both cases, all items in the tree was not rendered...

After digging in the javascript code, the issue seems comes from the webtreemap.js
I've replaced the imported scripts by these lines :

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script> <script src="https://cdn.rawgit.com/martine/webtreemap/a2fa353833eca1a4821ba4c93fb6a7d546aed02a/webtreemap.js"></script>

With this, more files are shown but unfortunetly not all.
Regards

from source-map-explorer.

danvk avatar danvk commented on May 13, 2024

That last comment about webtreemap is interesting. Do you see your files if you run source-map-explorer --json build/static/js/main.*? Is it possible that your code is just too small to get rendered in the treemap?

from source-map-explorer.

psequest avatar psequest commented on May 13, 2024

Unfortunately, the rendering issue is not dependent of the file size...
Editing the generated page, I did some tests where I deleted some paths in the tree and the rendering had a strange behaviour. I put too some console.log to be sure that the building of the treeData contains all nodes in according to the paths and it was the case...
When I replaced the imported scripts of underscore / webtreemap, the rendering was not the same for the same list of paths...

I attached the generated page that you can edit and display in your browser.
Hope this helps.
page.zip

from source-map-explorer.

nikolay-borzov avatar nikolay-borzov commented on May 13, 2024

Cannot reproduce on [email protected] and latest [email protected]
sme-result.zip

It would be helpful if somebody could provide links to js and map files to reproduce the issue

from source-map-explorer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.