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

Temporarily comment out bundle-collapser for JSXTransformer #2884

Merged
merged 1 commit into from
Jan 21, 2015

Conversation

chenglou
Copy link
Contributor

This will at least make the examples run while we fix the issue.

@chenglou
Copy link
Contributor Author

9bc1961#commitcomment-9349605

@zpao (not sure how to ping ShihChi)

@chenglou
Copy link
Contributor Author

Also, all the examples requiring *.min throw a big red error in the console for the lack of source maps. Kinda ugly.

@chenglou chenglou mentioned this pull request Jan 20, 2015
@zpao
Copy link
Member

zpao commented Jan 21, 2015

OK figured out why this is happening. There's a caught error when using amdefine, which is used by source-map-generator (and others) to make a browser compatible package. Anyway, inside amdefine, it looks at the type of the argument. If it's a string, it treats it like a regular synchronous require. If it's not a string it assumes the argument is an array of strings, so it uses dep.map, which throws because dep is the number 10. Specifically, see https://github.com/jrburke/amdefine/blob/master/amdefine.js#L110-L126

So yea, we can't use bundle-collapser here. Hopefully it doesn't randomly break in the future.

Alternatively we could update bundle-collapser to use '10' instead of 10 for the module identifiers which would sneakily get around the bug. Or also update the source-map-* tools to not use amdefine (might be good anyway).

Can you update the comment there to mention the restriction being amdefine, which is a dependency of a dependency. Then let's merge it in.

Nice catch all around, by the way. We probably would have found it but it would have been the day before a release.

@chenglou chenglou force-pushed the fix-ex-source-map branch 2 times, most recently from 843ea5e to 5194ae0 Compare January 21, 2015 01:27
This will at least make the examples run while we fix the issue.
@chenglou
Copy link
Contributor Author

👍

@zpao
Copy link
Member

zpao commented Jan 21, 2015

Thanks!

zpao added a commit that referenced this pull request Jan 21, 2015
Temporarily comment out bundle-collapser for JSXTransformer
@zpao zpao merged commit ce5346f into facebook:master Jan 21, 2015
@chenglou chenglou deleted the fix-ex-source-map branch January 21, 2015 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants