-
Notifications
You must be signed in to change notification settings - Fork 84
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
MapillaryJS's minified production build seems to be broken #283
Comments
Thanks for reporting and providing the steps and example repository to reproduce. The minified distribution should be working. Good that you found a workaround for now. |
I used patch-package to automatically patch Mapillary-js's package.json file with this workaround solution and it works well. Be advised that you need version 6 (beta) of
Put it in @oscarlorentzon when will this be fixed? MapillaryJS is fundamentally broken in production, which is bad since its hard to notice while developing. I want to be clear that this patch is a very short-term solution and relies on the end-user having a minification step in their build process. I can probably get the time to do a PR if the fix isn't imminent, but that will be after a week or so. |
@danieldunderfelt Thanks for the update. @goncalo-godwitlabs @danieldunderfelt Can you explain what is different in a react production build compared to a development build? Is there some optimization happening and in that case what does it do? |
@oscarlorentzon The error is in MapillaryJS's minified production build that is distributed along with the npm install, so it's not relevant whether the project uses React or not. This issue is a bit mistitled. Using the unminified version of mapillaryJS works, which is what the workaround does. The error that leads to the minified build failing needs to be addressed, it is not enough to just use the unminified script. |
@danieldunderfelt I see. Reason for asking is that all the examples in the documentation uses the minified javascript file and there everything works as expected. Therefore I figured that the React production build does something during its its build steps with the dependencies it includes. @danieldunderfelt Is your error message the same as the one @goncalo-godwitlabs gets? In any case, I will investigate the issue. |
@oscarlorentzon Maybe the npm distribution uses an older version, and the one distributed through script tags works? Try installing mapillary-js with npm and see if it works. The error message I got was slightly different, about |
@danieldunderfelt Will try, thanks for the info. |
I have changed the issue title, I guess it makes more sense now, thanks @danieldunderfelt. |
Fixes #283 Compressing during minification causes React and Angular app production builds to throw error in Threejs rendeBufferDirect method where a function is missing. Removing compression causes about a 5 percent increase in minified bundle size.
Hello,
Thanks for mapillary-js and Mapillary in general, this is great stuff.
I am experiencing a small issue integrating mapillary-js in a React app and running the production build. It seems to me an issue with mapillary-js since I cannot reproduce it with the other dependencies, but I am not sure, it could be something with my setup. Also found a workaround I describe below. Follows the issue:
Basic information
MapillaryJS version:
2.12.1
System/Browser:
Ubuntu linux running Firefox 61.0.1 (64-bit) and Chrome 68.0.3440.106 (Official Build) (64-bit)
Steps to Reproduce Behavior
Expected behavior
The web app is expected to start just as if run in dev mode with
npm start
which runs without issues.Actual behavior
The app raises the following exception:
Workaround
Build the app with mapillary non-minified source by changing the respective package.json entry from
"main": "dist/mapillary.min"
to"main": "dist/mapillary"
.The text was updated successfully, but these errors were encountered: