IjzerenHein / react-native-bundle-visualizer

See what packages are increasing your react-native bundle size 📦
MIT License
1.46k stars 44 forks source link

Running bundle visualizer in Expo project using Expo Router #123

Open RobertPetricevic opened 12 months ago

RobertPetricevic commented 12 months ago

I'm getting the following error when trying to run bundle visualizer:

Error: The resource /Users/............../expo-router/entry was not found.

Has anyone run on this issue before?

flexbox commented 10 months ago

confirmed here as well

❯ npx react-native-bundle-visualizer

Generating bundle...
                Welcome to Metro v0.76.8
              Fast - Scalable - Integrated

Error: The resource `/Users/.../expo-router/entry` was not found.
    at /Users/.../node_modules/metro/src/IncrementalBundler.js:276:24

=== error === Error: Command failed with exit code 1:

I think it's the same as https://github.com/IjzerenHein/react-native-bundle-visualizer/issues/93 we need to change the path of the sourcemap somehow

mojavad commented 9 months ago

I have a solution to this - will update here briefly.

mojavad commented 9 months ago

@flexbox @RobertPetricevic

  1. Run npx expo export -p web --dump-sourcemap in your project. This will create a dist directory with your exported project along with the sourcemaps.
  2. Run npx source-map-explorer dist/**/*.js to get the graphic representation of your sourcemaps.
flexbox commented 8 months ago

@mojavad Nice hack! thanks for sharing