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

Problem using with CRA 1.0 #35

Closed
stereobooster opened this issue May 24, 2017 · 3 comments
Closed

Problem using with CRA 1.0 #35

stereobooster opened this issue May 24, 2017 · 3 comments
Labels

Comments

@stereobooster
Copy link

stereobooster commented May 24, 2017

CRA stands for create-react-app. This repo is browserify plugin. You probably wonder how I get here with CRA, which in turn uses Webpack. Here is the story:

I'm trying to make react-mapbox-gl work with CRA. react-mapbox-gl is react component for mapbox-gl, which in turn use browserify and webworkify. I'm not sure if this problem of webworkify or not. I suppose because I see blobs and workers in stack trace. Tell me if this CRA/Webpack/Mapbox error.

Uncaught ReferenceError: e is not defined
Uncaught ReferenceError: e is not defined
33../support/isBuffer @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
104.util @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
131.../error/validation_error @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
145../reference/latest @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
159.../style-spec/validate_style.min @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
151.../style-spec/reference/latest @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
157.../style-spec/feature_filter @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
100.../style/style_layer_index @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
anonymous @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:3
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
t @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1 Uncaught ReferenceError: e is not defined
33../support/isBuffer @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
104.util @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
131.../error/validation_error @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
145../reference/latest @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
159.../style-spec/validate_style.min @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
151.../style-spec/reference/latest @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
157.../style-spec/feature_filter @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
100.../style/style_layer_index @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
anonymous @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:3
i @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
t @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1
(anonymous) @ blob:http://localhost:5000/fca6711b-f465-4d2d-a868-06d5196fac53:1

Related: alex3165/react-mapbox-gl#231

Note: prior CRA 1, for example 0.9.5, it worked fine.

To reproduce problem:

git clone https://github.com/stereobooster/react-mapbox-gl
cd react-mapbox-gl
git checkout webworkify-problem
cd example
yarn
yarn build 
# yarn global add serve
serve -s build
@davidascher
Copy link

I hadn't noticed this bug when I started down this rabbit hole myself. See mishoo/UglifyJS#2011 for a long parallel path.

TLDR: it seems this (https://github.com/substack/webworkify/blob/master/index.js#L63) code is violating some assumption that uglify is making, I suspect it's the same problem with browserify.

@stereobooster note: CRA 1.0.7 has this problem worked around, but it seems to me there's still an incompatibility between webworkify and uglify's comparisons compression assumptions.

@kzc
Copy link

kzc commented May 28, 2017

webworkify is not the problem.

facebook/create-react-app#2376 (comment)

mishoo/UglifyJS#2011 (comment)

@mourner
Copy link
Collaborator

mourner commented May 28, 2017

Great find, thank you @kzc! Looks like there's nothing we can do on the webworkify side to fix the issue then. Hopefully there will be a solution upstream.

@mourner mourner closed this as completed May 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants