Chatie / graphql

GraphQL Schema, Providers and APIs for Chatie
https://www.chatie.io
Apache License 2.0
4 stars 1 forks source link

Uncaught Error: Cannot find module "child_process" at webpackMissingModule #6

Closed huan closed 6 years ago

huan commented 6 years ago

When using @chatie/graphql in Ionic3, we got this error message.

It seems that export LocalServer in our main index.ts cause this WebPack error, even we never import it.

See Also

  1. https://github.com/d3/d3-request/issues/24#issuecomment-327232538
  2. https://github.com/alxshelepenok/gatsby-starter-lumen/pull/51
  3. https://github.com/webpack/webpack/issues/744

BTW: another related problem is when @chatie/graphql are using pkg-up to find package.json in local directories, the ionic will build without error or warning, but shows a Runtime Error Cannot read property 'prototype' of undefined .

huan commented 6 years ago

add browser: { fs: false, child_process: false } to the package.json would do the trick

See: https://github.com/asvd/jailed/issues/22

huan commented 6 years ago

It seems the problem solved.