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

webpack scrypt.js: Critical dependency: the request of a dependency is an expression #3018

Closed
dankins opened this issue Aug 9, 2019 · 28 comments
Assignees
Labels
1.x 1.0 related issues Bug Addressing a bug

Comments

@dankins
Copy link

dankins commented Aug 9, 2019

Description

Building on v.1.2.1 using create-react-app fails due to webpack warning /node_modules/web3-eth-accounts/src/scrypt.js Critical dependency: the request of a dependency is an expression" when CI=true (ie, fail on warnings)

Expected behavior

Building a create-react-app using webpack should succeed

Actual behavior

I am able to build everything locally, however the build fails in my CI environment. The warning is as follows:

/node_modules/web3-eth-accounts/src/scrypt.js
Critical dependency: the request of a dependency is an expression

I assume it is a result of this line:
https://github.com/ethereum/web3.js/blob/1.x/packages/web3-eth-accounts/src/scrypt.js#L17

Steps to reproduce the behavior

Error Logs

Creating an optimized production build...

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

/home/circleci/project/node_modules/web3-eth-accounts/src/scrypt.js
Critical dependency: the request of a dependency is an expression


info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run build stderr:
error Command failed with exit code 1.

Gists

Versions

  • web3.js: v1.2.1
  • nodejs: v10.16.0
  • browser: circleci
  • ethereum node:
@nivida
Copy link
Contributor

nivida commented Aug 9, 2019

Thanks for opening this issue! We will fix and release it asap.
The current workaround for you would be to suppress the webpack warning.

@nivida nivida added 1.x 1.0 related issues Bug Addressing a bug labels Aug 9, 2019
@Matelasse
Copy link

@nivida This is getting obnoxious and upvotes are increasing in number. How can we help to resolve this?

@michaelsbradleyjr
Copy link
Contributor

michaelsbradleyjr commented Aug 14, 2019

@Matelasse I'm working on a PR, at the request of @nivida, hopefully will have it up for review by tomorrow, I've just been pretty pressed for time this week.

See: #2938 (comment).

The webpack warning is just a warning, and it should be possible in your build pipeline or whatever to ignore it instead of failing (i.e. if you're experiencing a build failure — maybe check it's just a warning for you and not an actual failure).

My apologies for any frustration this has caused.

@michaelsbradleyjr
Copy link
Contributor

It’s currently a WIP, will be continuing today.

@wickstjo
Copy link

Could someone please clarify how to actually fix the warning?

@talaikis
Copy link

Could someone please clarify how to actually fix the warning?

Setting CI=false inside create-react-app .env, allows to build it.

@jjhesk
Copy link

jjhesk commented Sep 3, 2019

got the same problem here

@ishristov
Copy link

Is there a new status with the error?

kremalicious added a commit to oceanprotocol-archive/commons that referenced this issue Sep 11, 2019
* until fix in web3.js is released for web3/web3.js#3018
@ernestognw
Copy link

I'm using rescripts to allow modifications on the CRA webpack config, so I removed the exprContextCritical rule to avoid the warning for now. I know it's not the best solution so far, but will make the build pass while it's fixed by the web3 team.

Here's my .webpack.config.js and .rescriptsrc.js that overrides the CRA webpack config removing the warning

.webpack.config.js

module.exports = config => {
  config.module.exprContextCritical = false;
  return config;
};

.rescriptsrc.js

module.exports = [require.resolve('./.webpack.config.js')];

Hopefully this will help someone :)

snario added a commit to statechannels/statechannels that referenced this issue Sep 26, 2019
snario added a commit to statechannels/statechannels that referenced this issue Sep 26, 2019
lalexgap pushed a commit to statechannels/statechannels that referenced this issue Sep 26, 2019
* Merge pull request #417 from magmo/funding-strategy

player-b sends strategyApproved action when strategy is approved

* Merge pull request #418 from magmo/simplify-channel-state

Simplify channel state

* Merge pull request #420 from magmo/new-process-actions

Actions that spin up a new process

* Merge pull request #421 from magmo/code-cleaning

Code cleaning

* Merge pull request #422 from magmo/simplify-channel

Simplify channel

* Initialize new processes for new process actions

* Names imports consistently in redux/reducer

* Factor out sharedData to a constant in initializeNewProtocol

* Update packages/wallet/src/redux/reducer.ts

Co-Authored-By: kerzhner <1062379+kerzhner@users.noreply.github.com>

* Update packages/wallet/src/redux/reducer.ts

Co-Authored-By: kerzhner <1062379+kerzhner@users.noreply.github.com>

* Update packages/wallet/src/redux/reducer.ts

Co-Authored-By: kerzhner <1062379+kerzhner@users.noreply.github.com>

* Standardize protocol exports

* Fix inialized.test mocks

* Merge pull request #426 from magmo/direct-funding-channel-state

Wire up direct funding protocol with channel store

* Merge pull request #430 from magmo/ag-ledger-defunding

Ledger De-Funding

* Merge pull request #428 from magmo/application-protocol

Application protocol

* Merge pull request #436 from magmo/server

Add server package

* Merge pull request #423 from magmo/gk-concluding-protocol

Finish off Concluding protocol

* Merge pull request #439 from magmo/ag-get-funding-working-2

Changes to get Funding Process Working

* Merge pull request #440 from magmo/ag-adj-state-updating

Update shared data before protocol reducers

* Merge pull request #427 from magmo/indirect-funding2

Reworking indirect funding

* Merge pull request #446 from magmo/communication-module

Create communication module

* Merge pull request #449 from magmo/gk-cleanup-funding-storybook

Clean-up storybook

* Merge pull request #448 from magmo/gk-indirect-funding-views

Views for indirect-funding

* Merge pull request #455 from magmo/faster-tests

 Only test packages changed since master

* Merge pull request #452 from magmo/gk-indirect-funding-screens

Indirect-funding screens

* Merge pull request #457 from magmo/circle-cache

Cache dependencies for each package

* Merge pull request #456 from magmo/communication-module

Communication module

* Merge pull request #458 from magmo/funding

Funding protocol fixes

* Merge pull request #459 from magmo/ag-hook-up-funding-protocol

Add Indirect Funding Sub-protocol to funding protocol

* Merge pull request #462 from magmo/process-id

More unique process ids

* Merge pull request #460 from magmo/clean-up-funding-actions

Clean up funding actions

* Add common-data package

* Remove prebuilt contracts

* Rename magmo-common-data to magmo-wallet-common

* Merge pull request #453 from magmo/gk-split-concluding-protocol

Closes #451

* Merge pull request #442 from magmo/gk-two-player-consensus-commitment-interface

Indirect funding with the new Consensus App

* Merge pull request #470 from magmo/gk-monitor-ledger-channel

Use channelSubscriptions

* Merge pull request #471 from magmo/ag-app-to-app-working

Happy Path: App to App funding

* Merge pull request #472 from magmo/ag-ledger-defunding-update

Update Ledger De-funding to work with Consensus App

* Merge pull request #466 from magmo/adjudicator-watcher-common-data

Server adjudicator watcher

* Address renames from magmo/apps#466 review

* Use yarn workspaces

* Prettier jest config files

* transform using new location of babel-jest

The transform is not a little more brittle, but assuming the location of
the babel-jest module was already a bad idea

* Use new web3-utils api

* Invalidate circle cache

* Merge pull request #482 from magmo/export-from-wallet

Export code from wallet package

* Update yarn.lock

* Removing caches

* Trying out yarn install

* Set npmClient in package.json

* magmo-wallet-client is a dependency in rps

* add lerna run prepare to circle config

See lerna/lerna#1021

* Revert "Removing caches"

This reverts commit ac0c8ab049d879fc6632a437b6c564bdd07dbb60.

* Pinning web3 version to 1.0.0-beta.37

* Change lerna bootstrap to yarn install

* Changing heroku-postbuild for workspaces

* Merge pull request #485 from magmo/prebuilt-contracts

Remove ganache addresses from prebuilt contracts

* Merge pull request #484 from magmo/ag-direct-funding-race-condition

Fix Direct Funding Race Condition

* Merge pull request #475 from magmo/gk-concluding

Get concluding working

* Merge pull request #488 from magmo/fix-open-game-card

Fix OpenGameCard

* Requiring NODE_ENV to be set outside of .env files and source code

* Add .env.test

* Debug log lines

* Merge pull request #487 from magmo/conclude-instigated

Move ConcludeInstigated to communication module

* Merge pull request #494 from magmo/ag-fix-storybook

Upgrade storybook to fix storybook error

* Merge pull request #496 from magmo/build-last-in-circle

Build after running tests

* Fixing DEV_GANACHE_JSON_RPC_ENDPOINT

* Use magmo-devtools env loading

* Rename SERVER_NETWORK_ID to CHAIN_NETWORK_ID

* Start adjudicator watcher

* Rename yarn commands to 'functionality:action' style

* Adjudicator watcher: call listen only when run as main

* Update magmo-devtools

* Use configureEnvVariables from magmo-devtools

* Update yarn.lock

* Merge pull request #497 from magmo/remove-package-lockfiles

Remove package lockfiles

* Fork adjudicator watcher

* Remove adjudicator watcher from Procfile

* Build before adjudicator watcher tests

* Merge pull request #489 from magmo/ag-challenging

Get Challenging/Responding Working

* Add comment to fork in adjudicator-watcher.test.ts

* Add noUnusedLocals TS flag

* Add forceConsistentCasingInFileNames TS flag

* Fix unused variable error

* Add adjudicator watcher listen log line

* Build server in prestart

* Merge pull request #499 from magmo/server-protocols

Update server to communicate via protocol actions.

* Merge pull request #505 from magmo/gk-cleanup

Enforce consistency across protocols

* Merge pull request #510 from magmo/gk-dispute-responder-expirytime

Dispute responder is shown expiryTime

* Merge pull request #513 from magmo/ledger-channels

Ledger channels

* Merge pull request #514 from magmo/server-deposit-manager-rebased

Server deposit manager

* Add server run to launch.json

* Adding readme clarification

* Update packages/server/readme.md

Co-Authored-By: andrewgordstewart <andrew.gord.stewart@gmail.com>

* Merge pull request #515 from magmo/ag-channel-init-fix

Used one address per a wallet

* Merge pull request #519 from magmo/ag-scoped-wallet-package

Remove private field from wallet package.json

* Making the adjudicator watcher test synchronous

* Merge pull request #511 from magmo/gk-remove-terminated-processes

Overhaul actions

* Merge pull request #521 from magmo/ag-fix-compose-conclude

Fix composeConcludeCommitment

* Merge pull request #526 from magmo/gk-ttt-solidity-highlighting

Enable solidity highlighting in ttt

* Merge pull request #523 from magmo/gk-constant-destination

Ensure destination field does not change in application channels

* Merge pull request #524 from magmo/gk-reinstate-message-listener-tests

Reinstate message listener tests

* Merge pull request #527 from magmo/virtual-funding-spec

Virtual funding spec

* Merge pull request #528 from magmo/prepare-channel-protocol

AdvanceChannel protocol

* Merge pull request #531 from magmo/currentRound

Store arbitrary number of commitments on channelState

* Merge pull request #532 from magmo/advance-channel-reducer

WIP: Initializing the advance-channel protocol

* Merge pull request #533 from magmo/advance-channel-reducer

WIP: Advance channel reducer

* Merge pull request #525 from magmo/gk-cancelling-conclude

Allow `Application-` to continue when instigator cancels conclude

* Merge pull request #538 from magmo/advance-channel-reducer-post-fund

Advance channel reducer when channel exists

* Merge pull request #539 from magmo/advance-channel-reducer-safe-flaag

Add clearedToSend flag to advanceChannelState

* v0.2.0

* Merge pull request #542 from magmo/fix-version-issue

Update magmo-wallet dependency to ^0.2.0

* Merge pull request #540 from magmo/refactor-direct-funding

Refactor direct funding to use AdvanceChannel

* Merge pull request #544 from magmo/handle-new-relayable-actions

Handle new relayable actions

* Merge pull request #509 from magmo/ag-reuse-ledger

Re-Use Existing Ledger Channel

* Merge pull request #530 from magmo/gk-unnest-defunding-from-dispute

Un nest defunding from dispute

* Merge pull request #546 from magmo/ag-existing-channel-fix

Fix existing channel reducer

* Merge pull request #548 from magmo/protocol-locator

Add protocolLocator to `AdvanceChannel` state

* Merge pull request #550 from magmo/ag-n-player-consensus

Update Consensus Update protocol to support n players

* Merge pull request #551 from magmo/gk-redux-thunk

Use redux-saga to dispatch multiple actions

* Merge pull request #553 from magmo/improve-commitment-test-helpers

Improve commitment test helpers

* Merge pull request #554 from magmo/virtual-funding-protocol

WIP: Virtual funding protocol

* Merge pull request #562 from magmo/ag-validate-transition

Validate Transitions

* Merge pull request #563 from magmo/ag-existing-from-indirect

Rename ExistingChannelFunding to ExistingLedgerFunding and IndirectFunding to NewLedgerFunding

* Merge pull request #552 from magmo/gk-denest-defunding-from-concluding

De-nest defunding from concluding

* Merge pull request #558 from magmo/gk-nest-dispute-under-application

Nest Dispute under Application

* Merge pull request #555 from magmo/gk-multiple-relayable-actions

Relay multiple actions in an ordered batch

* Merge pull request #560 from magmo/ag-ledger-top-up-redesign

Ledger Top-Up Redesign

* Merge pull request #568 from magmo/gk-remove-stale-notes

Remove stale notes (redux diagrams)

* Merge pull request #567 from magmo/upgrade-fmg-packages

Upgrade fmg packages

* Merge pull request #565 from magmo/ag-new-indirect-funding

New Indirect Funding Protocol

* Merge pull request #571 from magmo/gk-upgrade-fmg-core-in-rps

Upgrade fmg-core in rps package

* Merge pull request #572 from magmo/gk-cleanup2

Clean up

* Merge pull request #573 from magmo/gk-existing-ledger-funding-ui

Existing ledger funding UI

* Add firebase address listener

* Add message sender to firebase-relay

* Remvove rps_games route

* Send messages via firebase only for the /api/v2/channels route

* Make firebase into a dynamically instantiated singleton

* Remove stale comment

* Use firebase for GAME_ENGINE messages

* Merge pull request #577 from magmo/gk-storybook-overhaul

Storybook overhaul

* Merge pull request #578 from magmo/gk-use-shared-components

Use shared components

* Merge pull request #581 from magmo/virtual-funding

Split virtual funding states

* Add v1/channels route

* Make firebase-relay names more descriptive

* Add more descriptive variable names to firebase relay

* Merge pull request #582 from magmo/advance-channel-commitment-type

Add commitmentType to success state on advanceChannel

* Merge pull request #591 from magmo/ag-remove-old-test-data

Remove old test scenarios

* Merge pull request #586 from magmo/virtual-funding

Implement virtual funding to guarantor channel setup

* Merge pull request #589 from magmo/virtual-funding-application-funding

Implement virtual funding through application funding state

* Add instruction for how to start firebase relay

* Merge pull request #595 from magmo/ag-cu-cleared-to-send

add Cleared To Send support to Consensus Update Protocol

* Merge pull request #605 from magmo/ag-new-ledger-funding-refactor

Exchange Post Fund Setups in Funding/NewLedgerFunding

* Fix funding

* Strip --inspect-brk from argv for adjudicator watcher

* Move hub address and private key to environment variables

* Do not use bespoke dotenv loading in rps package.

* Changing one more DEV_GANACHE_PORT to GANACHE_PORT

* Add back NODE_ENV to env.js in rps

* Do not use configureEnvVariables in truffle.js

* Add back dotenv and dotenv-expand to rps and wallet

* Revert "Fix funding"

This reverts commit 4b0f51681a6bd282f4d0c3c0bab268060e5efeed.

* Merge pull request #608 from magmo/tslint-fix

TSLint fails on build/start

* Merge pull request #607 from magmo/ag-funding-fix

Get Funding working

* Merge pull request #610 from magmo/ag-funding-race-condition

Fix Funding Race Condition

* Merge pull request #613 from magmo/ag-indirect-target

Indirect Funding now accepts target allocation/destination

* Merge pull request #614 from magmo/server-constant-cleanup

Move seed/test constants to own file

* Merge pull request #615 from magmo/ag-keep-channel-open

Remove SendKeepLedgerChannelApproved

* Merge pull request #616 from magmo/upgrade-jest

Upgrade jest

* Merge pull request #604 from magmo/protocol-locator

Protocol locator type guards

* Merge pull request #617 from magmo/new-ledger-doesnt-fund

NewLedgerFunding protocol doesn't fund

* Merge pull request #620 from magmo/ag-funding-failure

Update Protocol Locator in various Reducers

* Merge pull request #621 from magmo/new-ledger-doesnt-fund-gk-tweaks

Minor tweaks to documentation for #617

* Merge pull request #623 from magmo/existing-ledger-fix

Correctly set funding state in New Ledger Channel protocol

* Merge pull request #596 from magmo/server-commitment-round

updateLedgerChannel now takes a round of commitments

* Merge pull request #628 from magmo/ag-ledger-top-up-fix

Fix Ledger Top Up

* Merge pull request #632 from magmo/update-notes

Slight update to protocol hierarchy

* Merge pull request #626 from magmo/ag-concluding-fix

Handle Commitment out of order in Concluding

* Merge pull request #631 from magmo/consensus-update-when-not-our-turn

More robust consensus-update protocol

* Merge pull request #633 from magmo/funding-choice

Offer choice of virtual or indirect funding when funding application channel

* Merge pull request #634 from magmo/clean-up-initializers

Clean up initializers

* Merge pull request #630 from magmo/ag-redux-storage

Implement redux storage

* Merge pull request #640 from magmo/ag-funding-refactor

Funding Refactor

* Merge pull request #641 from magmo/ag-virtual-funding-ui

Add basic UI for virtual Funding

* Merge pull request #642 from magmo/valid-transition

Valid transition

* Merge pull request #646 from magmo/ag-fix-invalid-trans

Fix Invalid Transition

* Merge pull request #645 from magmo/ag-virtual-strategy-action-fix

Fix Player B Container to choose VirtualFunding

* Merge pull request #643 from magmo/ag-server-comm

Separate out Messaging from Response logic

* Merge pull request #647 from magmo/ag-firebase-send-fix

Fix firebase sending

* Merge pull request #652 from magmo/ag-storage-flag

Add flag to control storage

* Merge pull request #648 from magmo/ag-commitment-handling

Get Virtual Funding Partially Working

* Merge pull request #650 from magmo/ag-guarantee-channel-2

Get Virtual Funding Working

* Merge pull request #655 from magmo/ag-virtual-defunding

Virtual De-funding

* Merge pull request #661 from magmo/ag-advance-channel-concluding

Add Conclude support to AdvanceChannel

* Merge pull request #659 from magmo/ag-indirect-funding-refactor

Refactor Indirect-Defunding to use AdvanceChannel and ConsensusUpdate

* Merge pull request #658 from magmo/ag-virtual-defundng-integration

Add Virtual De-Funding to de-funding protocol.

* Merge pull request #666 from magmo/ag-rename-indirect-funding

Rename Indirect Funding to Ledger Funding

* Merge pull request #665 from magmo/ag-add-concluding-tests

Add Concluding Tests

* Merge pull request #668 from magmo/ag-end-process

Remove process when its done

* Merge pull request #667 from magmo/ag-defunding-redesign

Rework Concluding/Defunding

* Merge pull request #673 from magmo/ag-handle-invalid-app-transition

Handle invalid app transitions

* Merge pull request #672 from magmo/ag-partial-funding-fix

Fix Existing Ledger Channel Funding

* Add simple priority queue

* Revert "Add simple priority queue"

This reverts commit 6da0bf51bea2b171eb823a90f57af47bd9e19896.

* Merge pull request #676 from snario/liam/nvmrc

Add .nvmrc

* Merge pull request #675 from magmo/ag-update-master-protocol-doc

Update protocols doc to reflect recent changes

* Merge pull request #677 from magmo/ag-update-server-readme

Remove outdated instructions from server readme

* Deploy new contracts

* Deploy ETHAssetHolder

* Add signedState to commitment

* Fix yarn install issue

* Remove asAddress from converter

* Fix server compile error

* Fix length check

* ForceMove now uses nitro-protocol

* Add artifacts (with no deploy info)

* Do not use test game artifact for now

* Add createDepositTransaction

* Merge pull request #687 from magmo/switch-to-nitro-createRespondWithMoveTransaction

Update respond transaction to use nitro protocols

* Merge pull request #688 from magmo/switch-to-nitro-concludeTransactionWithNitro

Update createConcludeTransaction to nitro interface

* Update createConclude and skip failing tests

* Switch to local magmo wallet client

* Add wallet from magmo/apps

* Prettier write

* Remove sha3 dependency

* Get things compiling

* Remove obsolete .circleci

* SKIP_PREFLIGHT_CHECK=true

* Fix contract references

* Fix some old devtools refs

* Remove babel-preset

* Upgrade jest/ts-jest

* Try running tests serially

* add build:ci script

* Monorepo adjustments to support adding magmo/wallet (#49)

* Add types field to package.json of nitro-protocol

* Add a few exports to @statechannels/nitro-protocol useful in wallet

* Add mini-css-extract-plugin dependency to wallet

* Add ERC20AssetHolder.json to pre-built-artifacts

* Change imports of @statechannels/nitro-protocol to use distributed object, not files

* Return AddressZero if pre-built-artifact has no network address

* Run yarn

* Apply prettier:write to index.ts

* Use persisted workspaces in split CircleCI jobs (#51)

* Add packages/<star>/node_modules to dependencies cache paths in CircleCI

* Add packages/<star>/node_modules to workspace persisted paths

* Update CircleCI to use test:ci command

* Use require statement to lazy evaulate contract builds

* Fix typo

* Remove trailing-comma rule in tslint.json to get webpack build working

* Add CI=false to get around web3/web3.js#3018
@jjhesk
Copy link

jjhesk commented Oct 4, 2019

same problem again v1.2.1

@blockchaingate
Copy link

same problem:
WARNING in ./node_modules/web3-eth-accounts/src/scrypt.js 17:50-60
Critical dependency: the request of a dependency is an expression

@alexbrtsv
Copy link

same problem:
WARNING in ./node_modules/web3-eth-accounts/src/scrypt.js 17:50-60
Critical dependency: the request of a dependency is an expression

It fix if modify node: false; with node: { buffer: true } in
nodes_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js
but its not good solution)

Versions
web3: "^1.2.1",
Angular CLI: 8.3.6
Node: 12.11.0
OS: darwin x64
Angular: 8.2.8

@tharinduvindula
Copy link

tharinduvindula commented Oct 12, 2019

WARNING in ./node_modules/web3-eth-accounts/src/scrypt.js 17:50-60
Critical dependency: the request of a dependency is an expression
what is the solushion

"dependencies": {
"@agm/core": "1.0.0-beta.5",
"@angular/animations": "7.0.2",
"@angular/cdk": "7.0.2",
"@angular/common": "7.0.2",
"@angular/compiler": "7.0.2",
"@angular/core": "7.0.2",
"@angular/forms": "7.0.2",
"@angular/http": "7.0.2",
"@angular/material": "7.0.2",
"@angular/platform-browser": "7.0.2",
"@angular/platform-browser-dynamic": "7.0.2",
"@angular/platform-server": "7.0.2",
"@angular/router": "7.0.2",
"@ngrx/effects": "^7.0.1",
"@ngrx/entity": "^7.0.1",
"@ngrx/router-store": "^7.0.1",
"@ngrx/store": "^7.0.1",
"@ngrx/store-devtools": "^7.0.1",
"@types/base-64": "^0.1.3",
"@types/utf8": "^2.1.6",
"ajv": "6.4.0",
"arrive": "2.4.1",
"base-64": "^0.1.0",
"bip32": "git+https://github.com/bitcoinjs/bip32.git#patchRmd160-2",
"bootstrap": "4.3.1",
"bootstrap-material-design": "4.1.1",
"bootstrap-notify": "3.1.3",
"chartist": "0.11.0",
"classlist.js": "1.1.20150312",
"core-js": "2.4.1",
"express": "4.16.3",
"flag-icon-css": "^3.4.2",
"fusioncharts": "^3.13.4",
"fusionmaps": "^3.13.1-sr.1",
"googleapis": "28.1.0",
"hammerjs": "2.0.8",
"intl": "^1.2.5",
"jquery": "3.4.1",
"moment": "2.22.1",
"node-pre-gyp": "^0.13.0",
"npm-packlist": "^1.4.6",
"nyc": "^14.1.1",
"perfect-scrollbar": "1.1.0",
"popper.js": "1.14.3",
"rxjs": "6.3.3",
"rxjs-compat": "6.3.3",
"utf8": "^3.0.0",
"web-animations-js": "2.3.1",
"web3": "^1.0.0-beta.37",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^7.4.3",
"@angular-builders/dev-server": "^7.3.1",
"@angular-devkit/build-angular": "^0.13.8",
"@angular/cli": "6.0.3",
"@angular/compiler-cli": "^7.2.12",
"@angular/language-service": "7.0.2",
"@types/bootstrap": "3.3.32",
"@types/chartist": "0.9.34",
"@types/googlemaps": "3.30.8",
"@types/jasmine": "2.5.38",
"@types/jquery": "^1.10.35",
"@types/node": "^6.0.73",
"babel-cli": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"bootstrap": "^4.1.0",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chai-bignumber": "^3.0.0",
"codelyzer": "4.2.1",
"dotenv": "^8.1.0",
"ganache-cli": "^6.1.8",
"jasmine-core": "3.1.0",
"jasmine-spec-reporter": "4.2.1",
"jquery": "^3.2.1",
"karma": "2.0.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.4.2",
"karma-jasmine": "1.1.1",
"lite-server": "^2.3.0",
"nodemon": "^1.17.3",
"protractor": "5.3.1",
"solidity-coverage": "^0.6.7",
"truffle": "5.0.0-beta.0",
"truffle-contract": "3.0.6",
"truffle-hdwallet-provider": "^1.0.17",
"ts-node": "5.0.1",
"tslint": "5.9.1",
"typescript": "3.1.6",
"webpack-merge": "^4.2.2"
}
}

@joshstevens19
Copy link
Contributor

joshstevens19 commented Oct 12, 2019

so to get your angular app to work on web3 version 2 i wrote a angular script which executes on postinstall but that doesn't seem to exist in 1.0. The dependency warning itself is just a warning so you can still run the app without that being fixed.

If you drop this in your project on the route and then execute it with node it should allow your angular app to work. Il do a PR when i get a chance to put that script in web3 1.0 as well.

const fs = require('fs');
const f = './node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js';

// This is because we have to replace the `node:false` in the `/angular-cli-files/models/webpack-configs/browser.js`
// with `node: {crypto: true, stream: true}` to allow web3 to work with angular (as they enforce node: false.)
// as explained here - https://github.com/ethereum/web3.js/issues/2260#issuecomment-458519127
if (fs.existsSync(f)) {
    fs.readFile(f, 'utf8', function(err, data) {
        if (err) {
            return console.log(err);
        }
        var result = data.replace(/node: false/g, 'node: {crypto: true, stream: true}');
        fs.writeFile(f, result, 'utf8', function(err) {
            if (err) return console.log(err);
        });
    });
}

#2260 (comment) < link to where i answered this before.

In terms of this dependency is anyone still looking at fixing it? been open for a while now happy to do a PR to fix it if not.

@nivida
Copy link
Contributor

nivida commented Oct 13, 2019

This got fixed with the following commit and will be released asap.

@nivida nivida closed this as completed Oct 13, 2019
@ItalyPaleAle
Copy link

@nivida version 1.2.1 didn't solve this for me

I still get error:

WARNING in ./node_modules/web3-eth-accounts/src/scrypt.js 17:50-60
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/web3-eth-accounts/src/index.js
 @ ./node_modules/web3-eth/src/index.js
 @ ./node_modules/web3/src/index.js
 @ ./src/lib/EthWallet.js
 @ ./src/views/AccountView.svelte
 @ ./src/entry/account.js
 @ multi ./src/entry/account.js

@nivida
Copy link
Contributor

nivida commented Oct 13, 2019

It will be released with 1.2.2

@tharinduvindula
Copy link

when 1.2.2 release

@SpiegelSoft
Copy link

This is still happening for me (v1.2.4)

@nivida
Copy link
Contributor

nivida commented Jan 6, 2020

@SpiegelSoft Be sure you have updated the package-lock file of your project.

@Liberalite
Copy link

@SpiegelSoft Be sure you have updated the package-lock file of your project.

Screenshot 2020-01-09 at 16 42 17

Deleted package-lock and tried npm & yarn but i still get the same errors using CRA.
Any other suggestions ? Thanks !

@nivida
Copy link
Contributor

nivida commented Jan 9, 2020

@Liberalite Thanks for asking! As it looks like is it not resolving the package entry correctly. We have defined the browser property in the package.json of the scrypt-shim package to fix the warning from your screenshot. If the mainFields and target property of the webpack configuration is defined correctly. Will it use the browser entry if it exists in the package it wants to resolve.

@Liberalite
Copy link

@nivida Can you please share some code ?
I'm failing misserably :D
I tried to add scrypt-shim, tried to add mainFields: ['browser'] inside resolve: { but still get the same two errors. Cheers !

@x5engine
Copy link
Contributor

I still get the issue too

image

@gjgd
Copy link

gjgd commented Feb 28, 2020

Same ^ It came back

@cgewecke
Copy link
Collaborator

@gigd @x5engine Could you run npm list web3 or yarn list web3 in your project and show the dependency tree? It's possible you have a Web3 version lower than 1.2.2 somewhere.

For example, here's someone in a webpack issue about this topic 7 days ago noting that @truffle/contract depends on 1.2.1.

@gjgd
Copy link

gjgd commented Feb 28, 2020

I didn't know about npm list web3 that's an awesome feature! Indeed the dependency tree shows versions of both web3@1.2.1 and web3@1.2.2.

That solves it for me

@kuzdogan
Copy link

How do you solve it @gjgd Don't we need to wait for the listed packages to upgrade to web3@1.2.2+?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests