Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Hint javascript bundler to ignore fs, node-fetch, and string_decoder in package.browser #147

Merged
merged 1 commit into from
Feb 26, 2019

Conversation

kangyizhang
Copy link

@kangyizhang kangyizhang commented Feb 25, 2019

When using tfjs with angular-cli, it will show can not resolve 'fs' error, because tfjs-data is using fs in node environment. (original issue: angular/angular-cli#10681)

So hint javascript bundler to ignore fs, node-fetch and string_decode through package.browser field.

This resolves tensorflow/tfjs#1274


This change is Reviewable

Copy link

@nsthorat nsthorat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you verify this solves the issue by using yalc in a fresh package? Then LGTM!

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @dsmilkov)

Copy link
Contributor

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, didn't know we already had browser.fs : false . +1 to Nikhil's comment. Would be great to reproduce the angular setup that the user complained about in the issue. Thanks!

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 2 of 1 approvals obtained (waiting on @dsmilkov)

@kangyizhang
Copy link
Author

Current browser.fs : false was added days ago and the PR was not included in the release when users filing the issue. I have tested angular demo with local tfjs-data package and it works fine.

@kangyizhang kangyizhang merged commit 53a8ec3 into master Feb 26, 2019
@kangyizhang kangyizhang deleted the kangyi-fs branch February 26, 2019 06:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module not found: Error: Can't resolve 'fs'
3 participants