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

Expo sentry web bundle splitting - filename hash is wrong and source code does not point to correct module .js files. #395

Closed
ricklove opened this issue Nov 27, 2024 · 1 comment

Comments

@ricklove
Copy link

ricklove commented Nov 27, 2024

Summary

When using getSentryExpoConfig(projectRoot), the .js file names change because their hash is different (after injecting the sentry code):

i.e.:
``/dist/_expo/static/js/web/icon-8a61e53244b286448b8a432cdea14d72.jschanges to/dist/_expo/static/js/web/icon-f86cfc2fc68c3b9798085a0aa35086c3.js`

However, the web js bundler imports for these .js modules are still pointing to the original filename.

Verification

  • Changing getSentryExpoConfig(projectRoot) back to getDefaultConfig(projectRoot) solves the problem.

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Web

SDK Version (managed workflow only)

52.0.11

Environment

expo-env-info 1.2.1 environment info:
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 20.18.0 - C:\Program Files\nodejs\node.EXE
npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
Watchman: 20200802.200524.0 - D:\Tools\watchman-v2020.08.03.00-windows\bin\watchman.EXE
Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

Use React.lazy to dynamically load a module (that uses a default export):

const DynamicComponent = React.lazy(() => import('.example.tsx'));

This will enable bundle splitting. Now use getSentryExpoConfig and the dynamic bundle will not be able to import.

Note: I have not tested that this minimal example will reproduce the error.

@ricklove
Copy link
Author

wrong repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant