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

fail to builddev or with webpack example - You may need an additional loader to handle the result of these loaders. #622

Open
Felixaverlant opened this issue Mar 20, 2022 · 0 comments

Comments

@Felixaverlant
Copy link

Hi there,
I'm trying to build the with-typescript-graphql nextjs example but it fails.

Problem

The problem is in next.config.js during the schema loader process.

Error message at build times

I tried multiple rules sets but they all return the same result:

You may need an additional loader to handle the result of these loaders.
> type X {
|   id: ID
|   title: String

Import trace for requested module:
./lib/schema.ts
./lib/apollo.ts
./pages/_app.tsx

What I tried

I've tried webpack config from your README:

    config.module.rules.push({
      test: /\.(tsx|graphql)$/,
      use: [
        {
          loader: "babel-loader",
          options: {
            presets: ["@babel/preset-typescript", "@babel/preset-react"],
          },
        },
        { loader: "graphql-let/loader" },
      ],
    });

But also :

    config.module.rules.push({
      test: /\.graphqls$/,
      exclude: /node_modules/,
      use: ["graphql-let/schema/loader"],

The rest of config files are exactly the same as the ones as in the README.

If you have any idea where things went south...
Thanks.

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