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

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted #98

Closed
rybkowskigrzegorz opened this issue Feb 4, 2022 · 2 comments · Fixed by #99

Comments

@rybkowskigrzegorz
Copy link

Hi 👋
I'm trying to compile ts library with hooks package, but keep getting error issues which point to umd module.

WARNING in ../../node_modules/@feathersjs/hooks/umd/utils.js 3:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ../../node_modules/@feathersjs/hooks/umd/base.js
 @ ../../node_modules/@feathersjs/hooks/umd/index.js
 @ ./src/plugins/ImageColorConverter/ImageColorConverter.ts 55:14-42
 @ ./src/index.ts 6:28-88

I have several issues like this. This is my webpack.config file that I'm using

const path = require('path')

module.exports = {
  entry: './src/index.ts',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'index.js',
    library: {
      name: 'productDesigner',
      type: 'umd',
    },
  },
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        loader: 'ts-loader',
        exclude: /node_modules/,
      },
    ],
  },
  resolve: {
    extensions: ['.ts', '.tsx', '.js'],
  },
  externals: {
    react: 'react',
    lodash: 'lodash',
  },
}

I'm using in in one submodule of this library.

Module versions
"@feathersjs/hooks": "0.7.2"

NodeJS version:
v16.13.0

Operating System:
macOS Monterey

Browser Version:
Chrome Version 97.0.4692.99 (Official Build) (arm64)

Module Loader:
"webpack": "5.68.0",

@daffl
Copy link
Member

daffl commented Feb 4, 2022

We have been seeing the same when trying to upgrade Feathers. I created a follow-up issue in the build tool that we are using. For now you might want to stick with version v0.6.5 which shouldn't have that problem and has mostly the same functionality.

@daffl
Copy link
Member

daffl commented Feb 5, 2022

Just verified that this has been fixed in the latest version I just published 😄

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

Successfully merging a pull request may close this issue.

2 participants