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

Bug: Failed to parse source map from on Ionic 6 with react-scripts@5 #43

Open
bipoza opened this issue May 17, 2022 · 0 comments
Open

Comments

@bipoza
Copy link
Contributor

bipoza commented May 17, 2022

Describe the bug
After upgrading to react-script@5 the following error appears in the console: Failed to parse source map from

The problem:
The problem here is that Ionic React 6 uses react-scripts@5. This new version of react-scripts has sourcemap parsing enabled and will log a warning when no sourcemaps are found for a library. This did not happen in Ionic React 5 as that version required react-scripts@4 which did not have sourcemap parsing.

To Reproduce
Steps to reproduce the behavior:

$ npm install -g @ionic/cli
$ ionic start myApp blank --type=react
$ cd myApp
$ npm install @capacitor/browser
$ npm install @capacitor-community/browser-react
$ ionic serve

Screenshots
capacitor-react-hooks-sourcemaps

Possible solution:

The same thing happened to me with a library we created to display images with pinch-to-zoom in Ionic React.
https://github.com/codesyntax/ionic-react-photo-viewer

In my case I have used rollupjs as a module builder, and adding the sourcemaps in the configuration works perfectly.
Example: https://github.com/codesyntax/ionic-react-photo-viewer/pull/14/files

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