-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Parcel build
breaking tfjs initialization logic (that works under parcel serve
)
#7239
Comments
For more context, this is the line I'm blowing up at in the production build (but works in Seems this line is pruned: This seems to be a known issue on the tfjs side: tensorflow/tfjs#5182
|
I would say that the listed sideffects are correct. The problem is that our glob matching of them doesn't check the right thing: parcel/packages/utils/node-resolver-core/src/NodeResolver.js Lines 1175 to 1179 in d4b4256
This should be true, but
I found a similar problem here: #7218 (comment) |
I'm using webpack & have the same error on my browser -
|
🐛 (maybe) bug report
🎛 Configuration (.babelrc, package.json, cli command)
Package.json:
Entire repo here: https://github.com/matthewlewisnewton/parcel-build-breakage
To see that it builds and tfjs initializes at localhost:1234
npm run localhost
To see it break under build at localhost:8080
npm run build && cd dist && python3 -m http.server 8080
🤔 Expected Behavior
parcel build --no-optimize
(or ideally,parcel build
with optimizations) should not break code that works under parcel serve.😯 Current Behavior
It looks like tfjs-backend-webgl has side effects that it isn't reporting or something, and parcel prunes them. Running the code served from parcel in development mode works as expected, however when running the code from parcel build I run into the follow error on initialization:
🔦 Context
This is probably a misbehaving tfjs module, that repo seems to run all kinds of code on module initialization that could break from being re-written / pruned. But I could not find a way to exclude these files from parcel's rewriting in a way that let them stay working.
💻 Code Sample
https://github.com/matthewlewisnewton/parcel-build-breakage
index.html:
index.ts:
🌍 Your Environment
The text was updated successfully, but these errors were encountered: