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

Unable to bundle Electron app when using seriate #71

Open
kczx3 opened this issue Jun 15, 2017 · 0 comments
Open

Unable to bundle Electron app when using seriate #71

kczx3 opened this issue Jun 15, 2017 · 0 comments

Comments

@kczx3
Copy link

kczx3 commented Jun 15, 2017

I am trying to bundle my electron app to use React and have it pre-compiled but am finding that I can't get this to work as it fails with module not found for several seriate dependencies. Below is my webpack.config.js. I had read elsewhere about defining an externals object in my webpack config and setting the missing modules to '{}'. While that allowed it to bundle and open via electron, I get other errors once trying to actually execute a query. Let me know if this should be addressed with webpack and not seriate.

var path = require("path");

module.exports = {
  entry: './renderer.js',
  output: {
    path: path.resolve(__dirname, "dist"),
    publicPath: '/dist',
    filename: 'renderer.js'
  },
  module: {
	  rules: [
		  {
			  test: /\.(js)$/,
			  exclude: /node_modules/,
			  loader: 'babel-loader',
			  query: {
				  presets: ['react']
			  }
		  }
	  ]
  }
};

And here is what I'm getting when running webpack.

$ npm start

> [email protected] start C:\Users\<user>\projects\electron\sysinfo
> webpack && electron .

Hash: ed15f733b84313165a53
Version: webpack 2.6.1
Time: 5454ms
      Asset     Size  Chunks                    Chunk Names
renderer.js  4.01 MB       0  [emitted]  [big]  main
   [0] ./~/process/browser.js 5.42 kB {0} [built]
   [5] ./~/fbjs/lib/warning.js 2.1 kB {0} [built]
  [11] ./~/fbjs/lib/ExecutionEnvironment.js 1.06 kB {0} [built]
  [18] ./~/lodash/index.js 411 kB {0} [built]
  [42] ./~/react/lib/React.js 5.08 kB {0} [built]
 [129] ./~/react/react.js 56 bytes {0} [built]
 [263] ./~/react-dom/lib/ReactMount.js 25.5 kB {0} [built]
 [269] ./~/react-dom/lib/getHostComponentFromComposite.js 740 bytes {0} [built]
 [278] ./~/react/lib/ReactElementValidator.js 9.2 kB {0} [built]
 [281] ./~/seriate/src/utils.js 992 bytes {0} [built]
 [309] ./~/react-dom/index.js 59 bytes {0} [built]
 [319] ./renderer.js 2.06 kB {0} [built]
 [452] ./~/react-dom/lib/ReactDOM.js 5.17 kB {0} [built]
 [514] ./~/react/lib/ReactPropTypes.js 500 bytes {0} [built]
 [525] ./~/seriate/src/index.js 3.48 kB {0} [built]
    + 586 hidden modules

WARNING in ./~/mssql/lib/tds-fix.js
Module not found: Error: Can't resolve 'tds' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\mssql\lib'
 @ ./~/mssql/lib/tds-fix.js 14:4-18
 @ ./~/mssql/lib ^\.\/.*$
 @ ./~/mssql/lib/main.js
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

WARNING in ./~/mssql/lib/tds-fix.js
Module not found: Error: Can't resolve 'tds/package.json' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\mssql\lib'
 @ ./~/mssql/lib/tds-fix.js 6:8-35
 @ ./~/mssql/lib ^\.\/.*$
 @ ./~/mssql/lib/main.js
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

WARNING in ./~/mssql/lib/tds-fix.js
Module not found: Error: Can't resolve 'tds/lib/tds-constants.js' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\mssql\lib'
 @ ./~/mssql/lib/tds-fix.js 13:4-39
 @ ./~/mssql/lib ^\.\/.*$
 @ ./~/mssql/lib/main.js
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

WARNING in ./~/whistlepunk/src/configParser.js
76:17-71 Critical dependency: the request of a dependency is an expression

WARNING in ./~/whistlepunk/src/configParser.js
78:36-59 Critical dependency: the request of a dependency is an expression

WARNING in ./~/whistlepunk/src/configParser.js
80:16-38 Critical dependency: the request of a dependency is an expression

ERROR in ./~/seriate/src/utils.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\seriate\src'
 @ ./~/seriate/src/utils.js 2:9-24
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

ERROR in ./~/mssql/lib/main.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\mssql\lib'
 @ ./~/mssql/lib/main.js 13:7-20
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

ERROR in ./~/mssql/lib/cli.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\mssql\lib'
 @ ./~/mssql/lib/cli.js 5:7-20
 @ ./~/mssql/lib ^\.\/.*$
 @ ./~/mssql/lib/main.js
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

ERROR in ./~/mssql/lib/tds.js
Module not found: Error: Can't resolve 'tds' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\mssql\lib'
 @ ./~/mssql/lib/tds.js 9:8-22
 @ ./~/mssql/lib ^\.\/.*$
 @ ./~/mssql/lib/main.js
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

ERROR in ./~/mssql/lib/msnodesql.js
Module not found: Error: Can't resolve 'msnodesql' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\mssql\lib'
 @ ./~/mssql/lib/msnodesql.js 9:14-34
 @ ./~/mssql/lib ^\.\/.*$
 @ ./~/mssql/lib/main.js
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

ERROR in ./~/whistlepunk/src/configParser.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\whistlepunk\src'
 @ ./~/whistlepunk/src/configParser.js 2:9-24
 @ ./~/whistlepunk/src/index.js
 @ ./~/seriate/src/log.js
 @ ./~/seriate/src/connections.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

ERROR in ./~/tedious/lib/connection.js
Module not found: Error: Can't resolve 'net' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\tedious\lib'
 @ ./~/tedious/lib/connection.js 61:11-25
 @ ./~/tedious/lib/tedious.js
 @ ./~/mssql/lib/tedious.js
 @ ./~/mssql/lib ^\.\/.*$
 @ ./~/mssql/lib/main.js
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

ERROR in ./~/tedious/lib/instance-lookup.js
Module not found: Error: Can't resolve 'dgram' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\tedious\lib'
 @ ./~/tedious/lib/instance-lookup.js 11:13-29
 @ ./~/tedious/lib/connection.js
 @ ./~/tedious/lib/tedious.js
 @ ./~/mssql/lib/tedious.js
 @ ./~/mssql/lib ^\.\/.*$
 @ ./~/mssql/lib/main.js
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js

ERROR in ./~/tedious/lib/message-io.js
Module not found: Error: Can't resolve 'tls' in 'C:\Users\Chris\projects\electron\sysinfo\node_modules\tedious\lib'
 @ ./~/tedious/lib/message-io.js 17:11-25
 @ ./~/tedious/lib/connection.js
 @ ./~/tedious/lib/tedious.js
 @ ./~/mssql/lib/tedious.js
 @ ./~/mssql/lib ^\.\/.*$
 @ ./~/mssql/lib/main.js
 @ ./~/mssql/index.js
 @ ./~/seriate/src/index.js
 @ ./components/App.js
 @ ./renderer.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start: `webpack && electron .`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start 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!     C:\Users\Chris\AppData\Roaming\npm-cache\_logs\2017-06-15T19_35_58_104Z-debug.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant