You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying out the --experimental-scope-hoisting flag, and it doesn't play nice with Web3. Can't say I'm surprised, Web3 is quite a large library and still in a beta stage. When I saw it wasn't working, I starting cutting out code until I was only importing Web3 and nothing else, which still resulted in an error during packaging with Property name expected type of string but got null.
I think I'll simply remove Web3 as an NPM dependency and load it temporarily from a CDN. It would be awesome to see them play nicely together at some point :)
Property name expected type of string but got null
at validate (/Users/codyredmond/Documents/Work/everyday/node_modules/@babel/types/lib/definitions/utils.js:161:13)
at Object.validate (/Users/codyredmond/Documents/Work/everyday/node_modules/@babel/types/lib/definitions/utils.js:172:7)
at validate (/Users/codyredmond/Documents/Work/everyday/node_modules/@babel/types/lib/validators/validate.js:17:9)
at builder (/Users/codyredmond/Documents/Work/everyday/node_modules/@babel/types/lib/builders/builder.js:46:27)
at Object.Identifier (/Users/codyredmond/Documents/Work/everyday/node_modules/@babel/types/lib/builders/generated/index.js:321:31)
at JSConcatPackager.wrapModule (/Users/codyredmond/Documents/Work/everyday/node_modules/parcel-bundler/src/packagers/JSConcatPackager.js:292:21)
at JSConcatPackager.addDeps (/Users/codyredmond/Documents/Work/everyday/node_modules/parcel-bundler/src/packagers/JSConcatPackager.js:239:25)
at JSConcatPackager.addDeps (/Users/codyredmond/Documents/Work/everyday/node_modules/parcel-bundler/src/packagers/JSConcatPackager.js:223:27)
at JSConcatPackager.addDeps (/Users/codyredmond/Documents/Work/everyday/node_modules/parcel-bundler/src/packagers/JSConcatPackager.js:223:27)
at JSConcatPackager.addDeps (/Users/codyredmond/Documents/Work/everyday/node_modules/parcel-bundler/src/packagers/JSConcatPackager.js:223:27)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! everyday@0.1.0 build: `parcel build src/web/index.html --experimental-scope-hoisting`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the everyday@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/codyredmond/.npm/_logs/2019-02-28T02_57_40_473Z-debug.log
💁 Possible Solution
I'll be loading web3 temporarily from a CDN. I've been reading over at web3 that they aren't too happy about the large sizes and inaccurate typing, so at least we know they're aware of it. I'm also curious about /~https://github.com/xf00f/web3x, but with the speed of development on web3, I'm not sure about how it can claim parity. I'll be looking into it.
🔦 Context
I just would love to keep using ParcelJS for building out ethereum apps. What an amazing bundler you have :D
🐛 bug report
I'm trying out the
--experimental-scope-hoisting
flag, and it doesn't play nice with Web3. Can't say I'm surprised, Web3 is quite a large library and still in a beta stage. When I saw it wasn't working, I starting cutting out code until I was only importing Web3 and nothing else, which still resulted in an error during packaging withProperty name expected type of string but got null
.I think I'll simply remove Web3 as an NPM dependency and load it temporarily from a CDN. It would be awesome to see them play nicely together at some point :)
🎛 Configuration (.babelrc, package.json, cli command)
web3@1.0.0-beta.46
in package.json.babelrc: just the default provided by ParcelJS. I'm not using a custom .babelrc.
cli:
parcel build src/web/index.html --experimental-scope-hoisting"
🤔 Expected Behavior
Expecting a little tree-shaking ;)
😯 Current Behavior
💁 Possible Solution
I'll be loading web3 temporarily from a CDN. I've been reading over at web3 that they aren't too happy about the large sizes and inaccurate typing, so at least we know they're aware of it. I'm also curious about /~https://github.com/xf00f/web3x, but with the speed of development on web3, I'm not sure about how it can claim parity. I'll be looking into it.
🔦 Context
I just would love to keep using ParcelJS for building out ethereum apps. What an amazing bundler you have :D
💻 Code Sample
This is a work in progress, but feel free trying to create a production build with experimental hoisting turned on using this feature branch: /~https://github.com/codydjango/everyday/tree/feature/experimental-scope-hoisting
🌍 Your Environment
The text was updated successfully, but these errors were encountered: