TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.

Home Page:https://www.blocknotejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'assignRef' is not exported from '@mantine/hooks'

wyvern800 opened this issue · comments

i've been trying to implement this library to my React project TypeCellOS/BlockNote, but after some other fixed issues i've been stuck in what I believe to be the last issue I may have to get it running. The strange thing is that I've followed the example code and even followed the getting started section and i'm still having the same issue and I don't know what it must be. Does anyone have an idea? i'm using react-scripts so babel is coupled to it's version, and I didn't eject the files, so I use customize-cra to override some babel and webpack things I must. and I even included the blocknote on babel transpilation, but it says the assignRef is not being exported from @blocknote/hooks as in the image, it must be a blocknote inner dependency, but I have no idea why this is happening.i've been trying to implement this library to my React project TypeCellOS/BlockNote, but after some other fixed issues i've been stuck in what I believe to be the last issue I may have to get it running. The strange thing is that I've followed the example code and even followed the getting started section and i'm still having the same issue and I don't know what it must be. Does anyone have an idea? i'm using react-scripts so babel is coupled to it's version, and I didn't eject the files, so I use customize-cra to override some babel and webpack things I must. and I even included the blocknote on babel transpilation, but it says the assignRef is not being exported from @blocknote/hooks as in the image, it must be a blocknote inner dependency, but I have no idea why this is happening.

[https://i.sstatic.net/oTsXtlsA.png](print screen of the issue)

My CRA (Create-react-app, reactscripts) version is 4.0.3. These are my libs in my package.json

"@blocknote/core": "^0.13.2",  
    "@blocknote/mantine": "^0.13.2",  
    "@blocknote/react": "^0.12.4"

I'm afraid to this cause i've been assigned to change TinyMCE to this BlockNote lib in my current job, its been a week and I still couldn't manage to make it work, and I tried another lib (editor.js) but the other didn't fit well to our needings.

I tried installing it from the BlockNote getting started docs and everything was supposed to work at first glance, but it didn't.

This is also my config-overrides.js:

const webpack = require('webpack');
const path = require('path');
const { addBabelPlugins, override, addWebpackPlugin } = require('customize-cra');

const includeTranspilation = (config) => {
  const includeLibs = ['@editorjs/editorjs', '@blocknote/react'];

  config.module.rules.forEach(rule => {
    if (rule.oneOf) {
      rule.oneOf.forEach(one => {
        if (one.loader && one.loader.includes('babel-loader')) {
          if (!one.include) {
            one.include = [];
          } else if (!Array.isArray(one.include)) {
            one.include = [one.include];
          }
          includeLibs.forEach(lib => {
            one.include.push(new RegExp(`node_modules/${lib}`));
          });
        }
      });
    }
  });

  return config;
};


module.exports = override(
  includeTranspilation,
  ...addBabelPlugins(
    [
      '@babel/plugin-transform-class-properties',
      { loose: true },
    ],
    [
      '@babel/plugin-transform-private-methods',
      { loose: true },
    ],
    [
      '@babel/plugin-transform-private-property-in-object',
      { loose: true },
    ],
    [
    '@babel/plugin-proposal-nullish-coalescing-operator',
    { loose: true }
    ]
  ),
  addWebpackPlugin(
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify(process.env.NODE_ENV),
      },
    })
  ),
);

Would a good soul please help me with this?

Try upgrading all depdencies to 0.13.4. I see there's a bit of a mismatch atm:

"@blocknote/core": "^0.13.2",
"@blocknote/mantine": "^0.13.2",
"@blocknote/react": "^0.12.4"