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

Webpack function in config is not called #41

Open
martonlederer opened this issue Dec 9, 2020 · 1 comment
Open

Webpack function in config is not called #41

martonlederer opened this issue Dec 9, 2020 · 1 comment

Comments

@martonlederer
Copy link

martonlederer commented Dec 9, 2020

I am trying to add "graphql-tag" to the webpack loaders, but the webapck function in the nextjs config is not being called.

Here's my next.config.js:

const withPlugins = require('next-compose-plugins'),
  withImages = require('next-images')

module.exports = withPlugins([withImages()], {
  i18n: {
    locales: ['en-US', 'hu'],
    defaultLocale: 'hu'
  },
  webpack(config, options) {     
    config.module.rules.push({
      test: /\.(graphql|gql)$/,
      use: [
        {
          loader: require.resolve('graphql-tag/loader')
        }
      ]
    })

    return config
  }
})

The missing loader error is still being thrown:

error - ./queries/products.gql 1:6
Module parse failed: Unexpected token (1:6)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> query {
|   allProducts {
|     id
@dustinlacewell
Copy link

Why hasn't this been addressed? Makes this library nearly unusable.

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

2 participants