truffle-box / drizzle-box

This box comes with everything you need to start using smart contracts from a react app with Drizzle. It includes drizzle, drizzle-react and drizzle-react-components to give you a complete overview of Drizzle's capabilities.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NPM (6.5.0) causes - uncaught at root at root error

jgege opened this issue · comments

commented

Hi,

It took me half a day to figure out but using the steps mentioned in the readme caused my app to threw the following error in the browser:

at contractsSaga 
 at takeEvery 
 at addContract 
 at instantiateContract 

The test failed as well:

 FAIL  src/App.test.js
  ● Test suite failed to run

    ReferenceError: [BABEL] /home/jgege/Apps/dev/eth/drizzle_unbox/unbox2/app/src/App.test.js: Unknown option: base.configFile. Check out http://babeljs.io/docs/usage/options/ for more information about options.

    A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

    Invalid:
      `{ presets: [{option: value}] }`
    Valid:
      `{ presets: [['presetName', {option: value}]] }`

    For more detailed information on preset configuration, please see https://babeljs.io/docs/en/plugins#pluginpresets-options.

      at Logger.error (node_modules/babel-core/lib/transformation/file/logger.js:41:11)
      at OptionManager.mergeOptions (node_modules/babel-core/lib/transformation/file/options/option-manager.js:226:20)
      at OptionManager.init (node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
      at File.initOptions (node_modules/babel-core/lib/transformation/file/index.js:212:65)
      at new File (node_modules/babel-core/lib/transformation/file/index.js:135:24)
      at Pipeline.transform (node_modules/babel-core/lib/transformation/pipeline.js:46:16)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.747s
Ran all test suites.

The solution was to remove the node_modules and the package-lock.json files and reinstall the packages using yarn. The strange thing is that I unboxed drizzle earlier in January and everything was fine using NPM. Furthermore, even If I go back to the following commit it is fine: 012698d

Is it on purpose that before the restructuring drizzle ^1.2.5 was in package.json, but in the current version it is ^1.2.4? I know it should let the package manager to use 1.2.5 but for me - I guess due to some dependency - it stays on 1.2.4.

npm --version
6.5.0

truffle version
Truffle v5.0.2 (core: 5.0.2)
Solidity v0.5.0 (solc-js)
Node v11.8.0

yarn --version
1.13.0

I'm using Manjaro btw.

commented

Okay so I just noticed that it was mentioned here as well:
#10 (comment)

If you don't mind I'll keep this open as the ticket mentioned above is from 2018 and the title is less obvious.

I suggest mentioning this problem in the readme as it was frustrating as hell to figure out what's going on :D

Had the same problem with a clean installation of drizzle-box. As suggested above, switching from npm to yarn solved the problem.

commented

Thanks, I've gone through the same issue using npm 6.4.1 & node 10.11.0 with truffle unbox drizzle
and with the drizzle tutorial (https://www.truffleframework.com/tutorials/getting-started-with-drizzle-and-react#wire-up-the-react-app-with-drizzle). Using yarn commands instead seems to overcome the problem.

commented

Same behaviour here, getting the exact same error while using npm.

Deleting node_modules and package-lock.json before reinstalling using yarn has solved the issue.

Any thoughts why this is happening?

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

commented

This issue has been closed, but can be re-opened if further comments indicate that the problem persists. Feel free to tag maintainers if there is no reply to further comments.