DevExpress / devextreme-reactive

Business React components for Bootstrap and Material-UI

Home Page:https://devexpress.github.io/devextreme-reactive/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rrule import (scheduler-core) error seems still to exist

NoerNova opened this issue · comments

Is there an existing issue for this?

  • I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

React Scheduler

Current Behaviour

Screenshot 2566-03-25 at 01 03 20

Expected Behaviour

DX components should correctly render.

Steps to Reproduce

To Reproduce

Environment

  • next: ^13.2.4
  • react: ^18.2.0
  • dx-react-core: ^4.0.3
  • dx-react-scheduler: ^4.0.3
  • dx-react-scheduler-material-ui: ^4.0.3
  • @mui/icons-material: ^5.11.11
  • @mui/lab: ^5.0.0-alpha.124
  • @mui/material: ^5.11.14
  • @mui/x-date-pickers: ^6.0.3
commented

Facing the same issue; in my app I want to update @mui/x-date-pickers to v6, but the Scheduler implodes with the rrule error when trying to do this.

Up until now this library has been great but this has been a blocker for a couple months now and it's making us reconsider changing the DevExtreme Reactive components for something else 😕

Environment:

  • next: ^12.3.0
  • react: ^18.2.0
  • dx-react-core: ^4.0.4
  • dx-react-scheduler: ^4.0.4
  • dx-react-scheduler-material-ui: ^4.0.4
  • @mui/icons-material: ^5.11.16
  • @mui/lab: ^5.0.0-alpha.126
  • @mui/material: ^5.12.0
  • @mui/x-date-pickers: ^6.6.0

Edit: upon further checking, it seems that even with MUI Date Pickers still at 5.0.20, the change from Scheduler from 4.0.2 to 4.0.3 introduces the breaking change. A patch version update should not introduce any breaking changes, so I hope this gets addressed soon.

commented

Hi @omgaunicorn ,

You need to add our packages to transpilePackages in next.config proper operation.

const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  transpilePackages: [
    '@mui/icons-material',
    '@mui/x-date-pickers',
    'rrule',
    '@devexpress/dx-react-core',
    '@devexpress/dx-scheduler-core',
    '@devexpress/dx-react-scheduler-material-ui',
    '@devexpress/dx-react-scheduler',
    '@devexpress/dx-react-grid-material-ui'
  ],
};

module.exports = nextConfig;

See the following ticket where we created an example: t1159998

We had the same issue after upgrading from 3.x to the latest version.
I can confirm adding these lines to our next.config.js fixed the issue for us.
Thanks!

commented

We have the same issue but we're not using Next. We're using Vite and the error pops up when running unit tests using Vitest. Is there anything similar we can do in the Vite configuration?

commented

Hi @EmielH
I didn't reproduce the issue using the latest vite application template.
Could you please verify if you're using the latest v4.0.4. If so, please modify my example to demonstrate how to reproduce the issue.
test-react-vite.zip

commented

Hi @artem-kurchenko
Thanks a lot for your reply! I have managed to create a reproduction scenario given your application template. If you run npm run test in this example, the error occurs.

The error started occurring after adding React Testing Library dependencies.

test-react-vite.zip

Thank you for using Devextreme Reactive. We use GitHub issues to track bug and feature requests. We process incoming issues as soon as possible. Issues that have been inactive for 30 days are closed. If you have an active DevExtreme license, you can contact us in our Support Center for updates. Otherwise, post your question on StackOverflow.

commented

The following configuration in vitest.config.ts should solve the issue in testing:

import react from "@vitejs/plugin-react";
import { defineConfig } from 'vitest/config';

export default defineConfig({
  plugins: [
    react()
  ],
  test: {
    environment: 'jsdom',
    deps: {
      inline: [
        "rrule", "@devexpress/dx-scheduler-core", "@devexpress/dx-react-scheduler", "@devexpress/dx-react-scheduler-material-ui", 
      ],
      registerNodeLoader: true,
      fallbackCJS: true,
      interopDefault: true
    },
  }
});