Skip to content

TypeError: use_prefers_color_scheme__WEBPACK_IMPORTED_MODULE_2__ is not a function #860

@Ark07

Description

@Ark07

Describe the bug

I was trying to integrate rich text editor , and came across this amazing package Blocknote , reduces more than half of the work required with tip tap

But When i added webpack 5 to my application
It started giving below error
TypeError: use_prefers_color_scheme__WEBPACK_IMPORTED_MODULE_2__ is not a function

Screenshot 2024-06-24 at 8 12 06 AM

Package.json

 "dependencies": {
    "webpack": "^5.92.1",
    "webpack-cli": "^5.1.4",
    "@blocknote/core": "^0.13.5",
    "@blocknote/mantine": "^0.13.5",
    "@blocknote/react": "^0.13.5",
    "@babel/core": "^7.24.7",
    "@babel/preset-env": "^7.24.7",
    "@babel/preset-react": "^7.24.7",
 }

webpack.config

entry: 'app/app.js',
 output: {
    path: path.resolve(process.cwd(), 'build'),
    publicPath: '/',
    filename: '[name].js',
    chunkFilename: '[name].chunk.js',
  },

Related issue maybe ? devforth/painterro#123 , webpack/webpack#12675

  • Node version: 20
  • Browser: Chrome

Thank you in advance for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions