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

fix(@amplify-ui-react): fix cant resolve 'fs' when bundling with webpack on windows #7222

Conversation

nubpro
Copy link
Contributor

@nubpro nubpro commented Nov 18, 2020

Issue #, if available:
Try to compile amplify-js on Windows.
You'll hit this nasty error

ERROR in ../amplify-ui-components/dist/esm-es5/amplify-radio-button_2.entry.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\xxx\Documents\amplify-js\packages\amplify-ui-components\dist\esm-es5'
 @ ../amplify-ui-components/dist/esm-es5/amplify-radio-button_2.entry.js 169:0-20 8737:17-19 8812:15-17 8892:15-17 9595:17-19 9670:15-17 9735:15-17
 @ ../amplify-ui-components/dist/esm-es5 lazy ^\.\/.*\.entry\.js$ include: \.entry\.js$ exclude: \.system\.entry\.js$ namespace object
 @ ../amplify-ui-components/dist/esm-es5/index-ea91d2e7.js
 @ ../amplify-ui-components/dist/esm-es5/loader.mjs
 @ ../amplify-ui-components/dist/loader/index.mjs
 @ ./lib/components.js
 @ ./lib/index.js
error Command failed with exit code 2.

Found the solution from webpack-contrib/css-loader#447.
I don't have access to Macbook currently, could someone test this change on macOS?

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

nubpro and others added 30 commits August 10, 2020 21:46
Co-authored-by: Alex Hinson <alexmhinson@gmail.com>
Co-authored-by: Eric Clemmons <eric@smarterspam.com>
* add amazon-cognito-identity-js tests to CCI
Co-authored-by: Sam Martinez <samlmar@amazon.com>
Co-authored-by: Eric Clemmons <eric@smarterspam.com>
)

upgrade DataStore missing config log from info to warn to avoid user error

Co-authored-by: Sam Martinez <samlmar@amazon.com>
Co-authored-by: Eric Clemmons <eric@smarterspam.com>
 - amazon-cognito-identity-js@4.3.4
 - @aws-amplify/ui-angular@0.2.15
 - @aws-amplify/ui-components@0.6.2
 - @aws-amplify/ui-react@0.2.15
 - @aws-amplify/ui-storybook@0.2.15
 - @aws-amplify/ui-vue@0.2.14
 - @aws-amplify/analytics@3.2.7
 - @aws-amplify/api-graphql@1.1.6
 - @aws-amplify/api-rest@1.1.6
 - @aws-amplify/api@3.1.23
 - @aws-amplify/auth@3.3.5
 - aws-amplify-angular@5.0.24
 - aws-amplify-react-native@4.2.5
 - aws-amplify-react@4.1.23
 - aws-amplify@3.0.24
 - @aws-amplify/cache@3.1.23
 - @aws-amplify/core@3.4.6
 - @aws-amplify/datastore@2.2.10
 - @aws-amplify/interactions@3.1.23
 - @aws-amplify/predictions@3.1.23
 - @aws-amplify/pubsub@3.0.24
 - @aws-amplify/pushnotification@3.1.10
 - @aws-amplify/storage@3.2.13
 - @aws-amplify/xr@2.1.23
Co-authored-by: Alex Hinson <alexmhinson@gmail.com>
This change allows a user of the socket to restart the subscription after it terminates without an error.
This can sometimes happen when devices enter or leave standby.

Co-authored-by: Eric Clemmons <eric@smarterspam.com>
Co-authored-by: Sam Martinez <samlmar@amazon.com>
* Adds lodash as an explicit dependency.
* update lodash imports

Co-authored-by: Alex Hinson <alexmhinson@gmail.com>
…ify#6639)

* Use cypress browser image in CircleCi

* Use 'included' cypress image for Cypress 4.12.1

Co-authored-by: Ivan Artemiev <29709626+iartemiev@users.noreply.github.com>
…t found (aws-amplify#6618)

* retry guest credentials if identity id isn't found
…#6684)

* feat(@aws-amplify/ui-components): Add ChatBot Component

Fixes: aws-amplify#5024

* amplify-chatbot initial import

* Use interface and comment out test

* Expose additional css variables and add icon variant to button

* Update snapshot

* Clean up code

* Remove unused test case

* Add snapshot testing

* Apply comments from @ashika01

* Rename --icon-color to --icon-fill

* Remove unused class css

* Update css for compatibility with existing components

* Set default height

* Integrate Interactions text message

* Update snapshots

* Simplify code

* Add audiorecorder and integrate voice chat

* Use interface over type

* Reorder functions and add byte descriptions

* Add loading animation

* Update interaction types

* Scroll to bottom

* set methods private

* Rename css class

* Update snapshot

* Add error handling and reorder functions

* Refactor error handling

* Refactor chatbot functions

* Cleanup

* Update snapshot

* Expose width css variable from amplify-button

* px to rem

* Expose width and height variable; Control height at top level

* Add header slot

* Add listening animation

* Cleanup

* Update angular module

* Move visualization to helper and downsample data array

* Separate animation scss

* Remove console.logs

* Control width / height at host; expose message colors

* Use I18n with strings

* Fix typo

* Use enum for chat state

* Revert width back to 100%

* Rename updateProps to validateProps

* Separate out interaction enum strings

* Move MIME type string to constants file

* Use async/await pattern in recorder.ts

* Check isBrowser and add silence props

* Separate init from recorder for async control

* Remove fieldId

* Add try catch around Interactions.send

* Remove requestId

* Update snapshot

* Expose Interactions types

* Remove duplicate logic

* Use enum to describe where the message is from

* Clean up css and set enum value

* Add slot description

* Simplify import

* Default noop to visualizer

* Comment AudioRecorder and separate constants

* Update snapshot

* Reorder css

* Enable conversationModeOn prop

* Update packages/amplify-ui-components/src/common/audio-control/helper.ts

Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>

* Move error strings to translations

* Remove trailing comma

* Wrap audioContext resume with error logger

* Try catch `resume` and make startRecording async

* Use callback based decode for safari

Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>

* ci: enable preview release from ui-components/main (aws-amplify#6648)

* Enable publish from ui-preview branch

* Revert checkout

Co-authored-by: Jordan Ranz <jordanmranz@gmail.com>

* fix(@aws-amplify/ui-components): Update scss and reset chat state upon finish  (aws-amplify#6652)

* Move width/height control to container level

* Add min-height to footer

* Reset chat state upon session finish

* Remove trailing comma

* Handle error based on whether it's recoverable or not

* Put a different placeholder if only voice is enabled

* Make dot color customizable

* Fix typo in translations

* Let users stop audio and remove speaking chat state

* Add --amplify-blue as bg chat color

* Remove console.error

* ci: add interactions integ test (aws-amplify#6678)

Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>
Co-authored-by: Jordan Ranz <jordanmranz@gmail.com>
 - amazon-cognito-identity-js@4.3.5
 - @aws-amplify/ui-angular@0.3.0
 - @aws-amplify/ui-components@0.7.0
 - @aws-amplify/ui-react@0.2.16
 - @aws-amplify/ui-storybook@0.2.16
 - @aws-amplify/ui-vue@0.2.15
 - @aws-amplify/analytics@3.2.8
 - @aws-amplify/api-graphql@1.1.7
 - @aws-amplify/api-rest@1.1.7
 - @aws-amplify/api@3.1.24
 - @aws-amplify/auth@3.3.6
 - aws-amplify-angular@5.0.25
 - aws-amplify-react@4.2.0
 - aws-amplify@3.0.25
 - @aws-amplify/cache@3.1.24
 - @aws-amplify/core@3.4.7
 - @aws-amplify/datastore@2.2.11
 - @aws-amplify/interactions@3.2.0
 - @aws-amplify/predictions@3.1.24
 - @aws-amplify/pubsub@3.0.25
 - @aws-amplify/pushnotification@3.1.11
 - @aws-amplify/storage@3.2.14
 - @aws-amplify/xr@2.1.24
manueliglesias and others added 18 commits October 2, 2020 16:24
 - @aws-amplify/ui-angular@0.4.5
 - @aws-amplify/ui-components@0.8.5
 - @aws-amplify/ui-react@0.2.22
 - @aws-amplify/ui-storybook@0.2.22
 - @aws-amplify/ui-vue@0.2.21
 - @aws-amplify/analytics@3.3.5
 - @aws-amplify/api-graphql@1.2.5
 - @aws-amplify/api-rest@1.2.5
 - @aws-amplify/api@3.2.5
 - @aws-amplify/auth@3.4.5
 - aws-amplify-angular@5.0.31
 - aws-amplify-react-native@4.2.7
 - aws-amplify-react@4.2.6
 - aws-amplify@3.3.2
 - @aws-amplify/cache@3.1.30
 - @aws-amplify/core@3.5.5
 - @aws-amplify/datastore@2.5.2
 - @aws-amplify/interactions@3.3.5
 - @aws-amplify/predictions@3.2.5
 - @aws-amplify/pubsub@3.2.3
 - @aws-amplify/pushnotification@3.2.5
 - @aws-amplify/storage@3.3.5
 - @aws-amplify/xr@2.2.5
…lify#6851)

* bugfix aws-amplify#5218: de/encode custom state using base16

* use aws-sdk hex encoding util

unit tests for url safe encoding/decoding

* avoid using TextEncoder to support IE11

Co-authored-by: Sam Martinez <samlmar@amazon.com>
…r OIDC (aws-amplify#6858)

* add token to currentAuthenticatedUser

* add api-graphql test for storage token
* Add production testing to ci

* Update side effects

Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>
 - @aws-amplify/ui-angular@0.4.6
 - @aws-amplify/ui-components@0.8.6
 - @aws-amplify/ui-react@0.2.23
 - @aws-amplify/ui-storybook@0.2.23
 - @aws-amplify/ui-vue@0.2.22
 - @aws-amplify/analytics@3.3.6
 - @aws-amplify/api-graphql@1.2.6
 - @aws-amplify/api-rest@1.2.6
 - @aws-amplify/api@3.2.6
 - @aws-amplify/auth@3.4.6
 - aws-amplify-angular@5.0.32
 - aws-amplify-react@4.2.7
 - aws-amplify@3.3.3
 - @aws-amplify/cache@3.1.31
 - @aws-amplify/core@3.6.0
 - @aws-amplify/datastore@2.6.0
 - @aws-amplify/interactions@3.3.6
 - @aws-amplify/predictions@3.2.6
 - @aws-amplify/pubsub@3.2.4
 - @aws-amplify/pushnotification@3.2.6
 - @aws-amplify/storage@3.3.6
 - @aws-amplify/xr@2.2.6
# Conflicts:
#	package.json
#	packages/amazon-cognito-identity-js/CHANGELOG.md
#	packages/amazon-cognito-identity-js/package-lock.json
#	packages/amazon-cognito-identity-js/package.json
#	packages/amplify-ui-angular/CHANGELOG.md
#	packages/amplify-ui-angular/package.json
#	packages/amplify-ui-components/CHANGELOG.md
#	packages/amplify-ui-components/package.json
#	packages/amplify-ui-components/src/components/amplify-button/readme.md
#	packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.scss
#	packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.tsx
#	packages/amplify-ui-components/src/components/amplify-chatbot/readme.md
#	packages/amplify-ui-components/src/components/amplify-icon-button/readme.md
#	packages/amplify-ui-components/src/components/amplify-icon/readme.md
#	packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.tsx
#	packages/amplify-ui-components/src/components/amplify-sign-in/readme.md
#	packages/amplify-ui-react/CHANGELOG.md
#	packages/amplify-ui-react/package.json
#	packages/amplify-ui-storybook/CHANGELOG.md
#	packages/amplify-ui-storybook/package.json
#	packages/amplify-ui-vue/CHANGELOG.md
#	packages/amplify-ui-vue/package.json
#	packages/analytics/CHANGELOG.md
#	packages/analytics/package.json
#	packages/api-graphql/CHANGELOG.md
#	packages/api-graphql/package.json
#	packages/api-rest/CHANGELOG.md
#	packages/api-rest/package.json
#	packages/api/CHANGELOG.md
#	packages/api/package.json
#	packages/auth/CHANGELOG.md
#	packages/auth/package.json
#	packages/aws-amplify-angular/CHANGELOG.md
#	packages/aws-amplify-angular/package.json
#	packages/aws-amplify-react-native/CHANGELOG.md
#	packages/aws-amplify-react-native/package.json
#	packages/aws-amplify-react/CHANGELOG.md
#	packages/aws-amplify-react/package.json
#	packages/aws-amplify-react/src/AmplifyI18n.tsx
#	packages/aws-amplify/CHANGELOG.md
#	packages/aws-amplify/package.json
#	packages/cache/CHANGELOG.md
#	packages/cache/package.json
#	packages/core/CHANGELOG.md
#	packages/core/package.json
#	packages/core/src/Platform/version.ts
#	packages/core/src/Util/Reachability.ts
#	packages/datastore/CHANGELOG.md
#	packages/datastore/package.json
#	packages/datastore/src/datastore/datastore.ts
#	packages/datastore/src/storage/adapter/AsyncStorageAdapter.ts
#	packages/datastore/src/storage/adapter/IndexedDBAdapter.ts
#	packages/datastore/src/storage/adapter/getDefaultAdapter/index.ts
#	packages/datastore/src/sync/processors/sync.ts
#	packages/datastore/src/types.ts
#	packages/interactions/CHANGELOG.md
#	packages/interactions/package.json
#	packages/predictions/CHANGELOG.md
#	packages/predictions/package.json
#	packages/pubsub/CHANGELOG.md
#	packages/pubsub/package.json
#	packages/pubsub/src/PubSub.ts
#	packages/pushnotification/CHANGELOG.md
#	packages/pushnotification/package.json
#	packages/storage/CHANGELOG.md
#	packages/storage/package.json
#	packages/xr/CHANGELOG.md
#	packages/xr/package.json
@nubpro nubpro changed the title fix(@amplify-ui-react) fix cant resolve 'fs' when bundling with webpack on windows fix(@amplify-ui-react): fix cant resolve 'fs' when bundling with webpack on windows Nov 18, 2020
@codecov
Copy link

codecov bot commented Nov 18, 2020

Codecov Report

Merging #7222 (3b79a98) into main (84b4a88) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #7222   +/-   ##
=======================================
  Coverage   73.12%   73.12%           
=======================================
  Files         213      213           
  Lines       13356    13356           
  Branches     2617     2617           
=======================================
  Hits         9766     9766           
  Misses       3394     3394           
  Partials      196      196           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84b4a88...3b79a98. Read the comment docs.

Copy link
Contributor

@wlee221 wlee221 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@wlee221 wlee221 merged commit a3f572e into aws-amplify:main Dec 2, 2020
@nubpro nubpro deleted the amplify-ui-react/bug/fix-cant-resolve-fs-webpack-windows branch December 3, 2020 06:30
CryogenicPlanet pushed a commit to MLH-Fellowship/amplify-js that referenced this pull request Jan 20, 2021
@github-actions
Copy link

github-actions bot commented Dec 4, 2021

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 4, 2021
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.