Skip to content

Error was not caught ReferenceError: require is not defined with 7.0 #5238

@joaogarin

Description

@joaogarin

Examples bug report

Example name

With apollo

Describe the bug

VM64:37 Error was not caught ReferenceError: require is not defined
at Module../node_modules/graphql/jsutils/instanceOf.mjs (instanceOf.mjs:31)

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to https://github.com/zeit/next.js/tree/canary/examples/with-apollo
  2. clone and npm install
  3. Launch site on http://localhost:3000
  4. See error

I can imagine other apollo examples also have the same issue after 7.x

Expected behavior

No errors.

Screenshots

screen shot 2018-09-20 at 16 57 34

System information

  • OS: [macOS]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of Next.js: [e.g. 7.0.0]

Additional context

Only happens when trying out 7.0. It seems related to webpack4 and the support on .mjs files..it could be also an issue with graphql-js, I cant really find anything there. maybe someone else can help finding this out..will gladly move issue there if thats the case. Also dont know if at this point 7.0 is stable..just wanted to see how bad an upgrade would be, probably still a bit soon for me ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions