react-native-bundle-visualizer icon indicating copy to clipboard operation
react-native-bundle-visualizer copied to clipboard

Running bundle visualizer in Expo project using Expo Router

Open RobertPetricevic opened this issue 2 years ago • 7 comments

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?

RobertPetricevic avatar Oct 04 '23 16:10 RobertPetricevic

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

flexbox avatar Nov 13 '23 09:11 flexbox

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

mojavad avatar Dec 18 '23 16:12 mojavad

@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.

mojavad avatar Dec 28 '23 16:12 mojavad

@mojavad Nice hack! thanks for sharing

flexbox avatar Jan 13 '24 10:01 flexbox