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

Postgraphile not working with webpack 5 #46

Open
mansigoel2793 opened this issue Mar 6, 2024 · 0 comments
Open

Postgraphile not working with webpack 5 #46

mansigoel2793 opened this issue Mar 6, 2024 · 0 comments

Comments

@mansigoel2793
Copy link

I have upgraded webpack from version 4 to version 5.

  • Package.json contains the following dependencies and upgraded versions:

"devDependencies": {
"aws-sdk": "^2.1569.0",
"cross-env": "^7.0.3",
"express": "^4.18.0",
"rimraf": "^3.0.2",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4",
"webpack-node-externals": "^3.0.0"
},
"dependencies": {
"aws-kms-thingy": "^2.0.0",
"aws-serverless-express": "^3.4.0",
"bufferutil": "4.0.6",
"cors": "^2.8.5",
"graphql": "15.8.0",
"pg": "^8.11.3",
"postgraphile": "^4.13.0",
"postgraphile-core": "^4.13.0",
"postgraphile-plugin-connection-filter": "^2.3.0",
"postgraphile-plugin-nested-mutations": "^1.1.0",
"proxy-agent": "^6.4.0",
"utf-8-validate": "5.0.9"
}

  • Webpack config is same as [https://github.com/graphile/postgraphile-lambda-example/blob/main/webpack.config.js]
const path = require('path');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const { options: postgraphileOptions } = require('./src/postgraphileOptions.js');

module.exports = {
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'index.js',
    **library: '',** 
/* Only change is to remove library as i was getting error "[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration.output.library should be a non-empty string." */ 
    libraryTarget: 'commonjs',
  },
  mode: 'production',
  target: 'node',
  plugins: [
    // Prevent loading pg-native (in a weird, backwards kind of way!)
    ...[
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': '"production"',
        'process.env.POSTGRAPHILE_ENV': '"production"',
        'process.env.NODE_PG_FORCE_NATIVE': JSON.stringify('1'),
        ...(postgraphileOptions.graphiql
          ? null
          : {
              'process.env.POSTGRAPHILE_OMIT_ASSETS': '"1"',
            }),
      }),
      new webpack.NormalModuleReplacementPlugin(/pg\/lib\/native\/index\.js$/, '../client.js'),
    ],
    
    // Omit websocket functionality from postgraphile:
    new webpack.NormalModuleReplacementPlugin(
      /postgraphile\/build\/postgraphile\/http\/subscriptions\.js$/,
      `${__dirname}/src/postgraphile-http-subscriptions.js`
    ),

    // Just in case you install express:
    new webpack.NormalModuleReplacementPlugin(
      /express\/lib\/view\.js$/,
      `${__dirname}/src/express-lib-view.js`
    ),
  ],
  node: {
    __dirname: false, // just output `__dirname`
  },
  optimization: {
    minimizer: [
      new TerserPlugin({
        terserOptions: {
          // Without this, you may get errors such as
          // `Error: GraphQL conflict for 'e' detected! Multiple versions of graphql exist in your node_modules?`
          mangle: false,
        },
      }),
    ],
  },
};
  • I am using yarn.

### I am getting error:

ERROR in ./node_modules/pg/lib/native/index.js 4:12-30 -- 4738 | Module not found: Error: Can't resolve './utils' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4739 | resolve './utils' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4740 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native) 4741 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native/utils) 4742 | no extension 4743 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/utils doesn't exist 4744 | .js 4745 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/utils.js doesn't exist 4746 | .json 4747 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/utils.json doesn't exist 4748 | .wasm 4749 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/utils.wasm doesn't exist 4750 | as directory 4751 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/utils doesn't exist 4752 | ModuleNotFoundError: Module not found: Error: Can't resolve './utils' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4753 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/Compilation.js:2029:28 4754 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:895:13 4755 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :10:1) 4756 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:332:22 4757 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :9:1) 4758 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:509:22 4759 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:151:11 4760 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:767:25 4761 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:979:8 4762 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:1109:5 4763 | @ ./node_modules/pg/lib/index.js 32:26-45 4764 | @ ./node_modules/postgraphile/build-turbo/postgraphile/postgraphile.js 4:13-26 4765 | @ ./node_modules/postgraphile/build-turbo/postgraphile/index.js 4:21-46 4766 | @ ./node_modules/postgraphile/build-turbo/index.js 12:21-46 32:23-48 4767 | @ ./node_modules/postgraphile/index.js 2:2-52 4768 | @ ./src/index.js 2:25-48 4769 |   4770 | ERROR in ./node_modules/pg/lib/native/index.js 5:11-35 4771 | Module not found: Error: Can't resolve './crypto/sasl' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4772 | resolve './crypto/sasl' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4773 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native) 4774 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native/crypto/sasl) 4775 | no extension 4776 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/sasl doesn't exist 4777 | .js 4778 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/sasl.js doesn't exist 4779 | .json 4780 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/sasl.json doesn't exist 4781 | .wasm 4782 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/sasl.wasm doesn't exist 4783 | as directory 4784 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/sasl doesn't exist 4785 | ModuleNotFoundError: Module not found: Error: Can't resolve './crypto/sasl' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4786 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/Compilation.js:2029:28 4787 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:895:13 4788 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :10:1) 4789 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:332:22 4790 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :9:1) 4791 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:509:22 4792 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:151:11 4793 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:767:25 4794 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:979:8 4795 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:1109:5 4796 | @ ./node_modules/pg/lib/index.js 32:26-45 4797 | @ ./node_modules/postgraphile/build-turbo/postgraphile/postgraphile.js 4:13-26 4798 | @ ./node_modules/postgraphile/build-turbo/postgraphile/index.js 4:21-46 4799 | @ ./node_modules/postgraphile/build-turbo/index.js 12:21-46 32:23-48 4800 | @ ./node_modules/postgraphile/index.js 2:2-52 4801 | @ ./src/index.js 2:25-48 4802 |   4803 | ERROR in ./node_modules/pg/lib/native/index.js 6:20-47 4804 | Module not found: Error: Can't resolve './type-overrides' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4805 | resolve './type-overrides' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4806 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native) 4807 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native/type-overrides) 4808 | no extension 4809 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/type-overrides doesn't exist 4810 | .js 4811 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/type-overrides.js doesn't exist 4812 | .json 4813 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/type-overrides.json doesn't exist 4814 | .wasm 4815 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/type-overrides.wasm doesn't exist 4816 | as directory 4817 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/type-overrides doesn't exist 4818 | ModuleNotFoundError: Module not found: Error: Can't resolve './type-overrides' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4819 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/Compilation.js:2029:28 4820 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:895:13 4821 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :10:1) 4822 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:332:22 4823 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :9:1) 4824 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:509:22 4825 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:151:11 4826 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:767:25 4827 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:979:8 4828 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:1109:5 4829 | @ ./node_modules/pg/lib/index.js 32:26-45 4830 | @ ./node_modules/postgraphile/build-turbo/postgraphile/postgraphile.js 4:13-26 4831 | @ ./node_modules/postgraphile/build-turbo/postgraphile/index.js 4:21-46 4832 | @ ./node_modules/postgraphile/build-turbo/index.js 12:21-46 32:23-48 4833 | @ ./node_modules/postgraphile/index.js 2:2-52 4834 | @ ./src/index.js 2:25-48 4835 |   4836 | ERROR in ./node_modules/pg/lib/native/index.js 8:27-61 4837 | Module not found: Error: Can't resolve './connection-parameters' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4838 | resolve './connection-parameters' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4839 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native) 4840 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native/connection-parameters) 4841 | no extension 4842 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection-parameters doesn't exist 4843 | .js 4844 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection-parameters.js doesn't exist 4845 | .json 4846 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection-parameters.json doesn't exist 4847 | .wasm 4848 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection-parameters.wasm doesn't exist 4849 | as directory 4850 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection-parameters doesn't exist 4851 | ModuleNotFoundError: Module not found: Error: Can't resolve './connection-parameters' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4852 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/Compilation.js:2029:28 4853 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:895:13 4854 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :10:1) 4855 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:332:22 4856 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :9:1) 4857 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:509:22 4858 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:151:11 4859 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:767:25 4860 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:979:8 4861 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:1109:5 4862 | @ ./node_modules/pg/lib/index.js 32:26-45 4863 | @ ./node_modules/postgraphile/build-turbo/postgraphile/postgraphile.js 4:13-26 4864 | @ ./node_modules/postgraphile/build-turbo/postgraphile/index.js 4:21-46 4865 | @ ./node_modules/postgraphile/build-turbo/index.js 12:21-46 32:23-48 4866 | @ ./node_modules/postgraphile/index.js 2:2-52 4867 | @ ./src/index.js 2:25-48 4868 |   4869 | ERROR in ./node_modules/pg/lib/native/index.js 10:15-36 4870 | Module not found: Error: Can't resolve './defaults' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4871 | resolve './defaults' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4872 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native) 4873 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native/defaults) 4874 | no extension 4875 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/defaults doesn't exist 4876 | .js 4877 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/defaults.js doesn't exist 4878 | .json 4879 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/defaults.json doesn't exist 4880 | .wasm 4881 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/defaults.wasm doesn't exist 4882 | as directory 4883 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/defaults doesn't exist 4884 | ModuleNotFoundError: Module not found: Error: Can't resolve './defaults' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4885 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/Compilation.js:2029:28 4886 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:895:13 4887 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :10:1) 4888 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:332:22 4889 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :9:1) 4890 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:509:22 4891 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:151:11 4892 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:767:25 4893 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:979:8 4894 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:1109:5 4895 | @ ./node_modules/pg/lib/index.js 32:26-45 4896 | @ ./node_modules/postgraphile/build-turbo/postgraphile/postgraphile.js 4:13-26 4897 | @ ./node_modules/postgraphile/build-turbo/postgraphile/index.js 4:21-46 4898 | @ ./node_modules/postgraphile/build-turbo/index.js 12:21-46 32:23-48 4899 | @ ./node_modules/postgraphile/index.js 2:2-52 4900 | @ ./src/index.js 2:25-48 4901 |   4902 | ERROR in ./node_modules/pg/lib/native/index.js 11:17-40 4903 | Module not found: Error: Can't resolve './connection' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4904 | resolve './connection' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4905 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native) 4906 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native/connection) 4907 | no extension 4908 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection doesn't exist 4909 | .js 4910 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection.js doesn't exist 4911 | .json 4912 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection.json doesn't exist 4913 | .wasm 4914 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection.wasm doesn't exist 4915 | as directory 4916 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/connection doesn't exist 4917 | ModuleNotFoundError: Module not found: Error: Can't resolve './connection' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4918 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/Compilation.js:2029:28 4919 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:895:13 4920 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :10:1) 4921 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:332:22 4922 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :9:1) 4923 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:509:22 4924 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:151:11 4925 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:767:25 4926 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:979:8 4927 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:1109:5 4928 | @ ./node_modules/pg/lib/index.js 32:26-45 4929 | @ ./node_modules/postgraphile/build-turbo/postgraphile/postgraphile.js 4:13-26 4930 | @ ./node_modules/postgraphile/build-turbo/postgraphile/index.js 4:21-46 4931 | @ ./node_modules/postgraphile/build-turbo/index.js 12:21-46 32:23-48 4932 | @ ./node_modules/postgraphile/index.js 2:2-52 4933 | @ ./src/index.js 2:25-48 4934 |   4935 | ERROR in ./node_modules/pg/lib/native/index.js 12:15-40 4936 | Module not found: Error: Can't resolve './crypto/utils' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4937 | resolve './crypto/utils' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4938 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native) 4939 | using description file: /codebuild/output/src3139/src/s3/00/node_modules/pg/package.json (relative path: ./lib/native/crypto/utils) 4940 | no extension 4941 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/utils doesn't exist 4942 | .js 4943 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/utils.js doesn't exist 4944 | .json 4945 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/utils.json doesn't exist 4946 | .wasm 4947 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/utils.wasm doesn't exist 4948 | as directory 4949 | /codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native/crypto/utils doesn't exist 4950 | ModuleNotFoundError: Module not found: Error: Can't resolve './crypto/utils' in '/codebuild/output/src3139/src/s3/00/node_modules/pg/lib/native' 4951 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/Compilation.js:2029:28 4952 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:895:13 4953 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :10:1) 4954 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:332:22 4955 | at eval (eval at create (/codebuild/output/src3139/src/s3/00/node_modules/tapable/lib/HookCodeFactory.js:33:10), :9:1) 4956 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:509:22 4957 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:151:11 4958 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:767:25 4959 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:979:8 4960 | at /codebuild/output/src3139/src/s3/00/node_modules/webpack/lib/NormalModuleFactory.js:1109:5 4961 | @ ./node_modules/pg/lib/index.js 32:26-45 4962 | @ ./node_modules/postgraphile/build-turbo/postgraphile/postgraphile.js 4:13-26 4963 | @ ./node_modules/postgraphile/build-turbo/postgraphile/index.js 4:21-46 4964 | @ ./node_modules/postgraphile/build-turbo/index.js 12:21-46 32:23-48 4965 | @ ./node_modules/postgraphile/index.js 2:2-52 4966 | @ ./src/index.js 2:25-48 4967 |   4968 | 2024-03-06 09:10:15: webpack 5.90.3 compiled with 7 errors in 13767 ms (a2d3b5d8e6e4a15e513f)

How can i resolve this issue? I need to use latest version of postgraphile with latest version of webpack.

##Additional information
I tried to remove
new webpack.NormalModuleReplacementPlugin(/pg/lib/native/index.js$/, '../client.js'),
from webpack.config.js . The application is successfully build but when i hit any api then getting error
{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'pg-native'",
"stack": [
"Runtime.ImportModuleError: Error: Cannot find module 'pg-native'",
" at _loadUserApp (/var/runtime/UserFunction.js:225:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:300:17)",
" at Object. (/var/runtime/index.js:43:34)",
" at Module._compile (internal/modules/cjs/loader.js:1114:14)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)",
" at Module.load (internal/modules/cjs/loader.js:979:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:819:12)",
" at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)",
" at internal/main/run_main_module.js:17:47"
]
}

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