react-scheduler / react-big-schedule

React Big Schedule is a powerful and intuitive scheduler and resource planning solution built with React.
https://react-big-schedule.vercel.app/
MIT License
99 stars 23 forks source link

Version 4.4.3 is broken #176

Open jovana opened 3 weeks ago

jovana commented 3 weeks ago

Checklist

Describe the bug

Attempted import error: 'SchedulerData' is not exported from 'react-big-schedule' (imported as 'SchedulerData'). ERROR in ./src/cointainers/booking/views/booking.planboard.view.js 28:26-39 export 'SchedulerData' (imported as 'SchedulerData') was not found in 'react-big-schedule' (module has no exports)

ERROR in ./src/cointainers/booking/views/booking.planboard.view.js 28:59-70 export 'DATE_FORMAT' (imported as 'DATE_FORMAT') was not found in 'react-big-schedule' (module has no exports)

ERROR in ./src/cointainers/booking/views/booking.planboard.view.js 28:73-86 export 'ViewType' (imported as 'ViewType') was not found in 'react-big-schedule' (module has no exports)

ERROR in ./src/cointainers/booking/views/booking.planboard.view.js 41:14-26 export 'ViewType' (imported as 'ViewType') was not found in 'react-big-schedule' (module has no exports)

ERROR in ./src/cointainers/booking/views/booking.planboard.view.js 46:14-27 export 'ViewType' (imported as 'ViewType') was not found in 'react-big-schedule' (module has no exports)

ERROR in ./src/cointainers/booking/views/booking.planboard.view.js 51:14-28 export 'ViewType' (imported as 'ViewType') was not found in 'react-big-schedule' (module has no exports)

ERROR in ./src/cointainers/booking/views/booking.planboard.view.js 56:14-30 export 'ViewType' (imported as 'ViewType') was not found in 'react-big-schedule' (module has no exports)

ERROR in ./src/cointainers/booking/views/booking.planboard.view.js 61:14-27 export 'ViewType' (imported as 'ViewType') was not found in 'react-big-schedule' (module has no exports)

ERROR in ./src/cointainers/booking/views/booking.planboard.view.js 588:43-52 export 'Scheduler' (imported as 'Scheduler') was not found in 'react-big-schedule' (module has no exports)

Reproduction Link/Code

na

Steps to reproduce

yarn add react-big-schedule

Running this:

import React, { useEffect, useReducer, useState } from 'react';
import { Scheduler, SchedulerData, ViewType, DATE_FORMAT, } from 'react-big-schedule';
import "react-big-schedule/dist/css/style.css";

const PlanBoardView = ({
    ...props
}) => {

return (
<Scheduler/>
);
};

Operating System

Mac

Browser

Chromium

React version

18.3.1

react-big-schedule version

4.4.3

Additional Information

4.4.1 is working. 4.4.2 has the same issue.

ansulagrawal commented 3 weeks ago

I will try and let you know

ansulagrawal commented 3 weeks ago

@jovana try uninstalling the library and install it again it will work as its working I have tested in codepen and stackblitz.

Stackblitz: https://stackblitz.com/edit/vitejs-vite-rdpjba

Codepen: https://codesandbox.io/p/sandbox/vftv8y

Codesanbox ss

ansulagrawal commented 3 weeks ago

Yes 4.4.2 is not working as I added type: module in package.json and forgot to update in babel file. That was the fixed did in 4.4.3

jovana commented 3 weeks ago

@ansulagrawal Thanks for your update and help. I have tried a lot of things.

Delete all packages, clear the cache, reinstall:

rm -rf yarn.lock
rm -rf node_modules/
yarn cache clean
yarn install

But does not solve any issues. Probably some conflicts in the packages I use, but can not figure it out. Now I have rolled back to 4.4.1 witch is still working fine.

This is my package.json

{
  "name": "admin",
  "jest": {},
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@ant-design/pro-layout": "7.21.1",
    "@monaco-editor/react": "^4.6.0",
    "@phosphor-icons/react": "^2.1.7",
    "accounting-js": "^1.1.1",
    "antd": "5.21.6",
    "axios": "^1.7.7",
    "heic2any": "^0.0.4",
    "highcharts": "^11.4.8",
    "highcharts-react-official": "^3.2.1",
    "moment": "^2.29.1",
    "moment-timezone": "^0.5.46",
    "qrcode.react": "^4.1.0",
    "react": "^18.3.1",
    "react-big-schedule": "4.4.1",
    "react-beautiful-dnd": "^13.1.1",
    "react-collapsed": "^4.1.2",
    "react-datepicker": "^7.5.0",
    "react-dom": "^18.3.1",
    "react-gravatar": "^2.6.3",
    "react-hook-form": "^7.53.1",
    "react-intl": "^6.8.4",
    "react-moment": "^1.1.1",
    "react-pdf": "8.0.2",
    "react-quill": "^2.0.0",
    "react-router-dom": "^6.27.0",
    "react-scripts": "^5.0.1",
    "react-signature-canvas": "^1.0.6",
    "react-to-print": "^2.15.1",
    "uuid": "^11.0.2",
    "validator": "^13.12.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jest-environment-jsdom-sixteen",
    "eject": "react-scripts eject",
    "mockapi": "node ./mock-api/app.js",
    "analyze": "source-map-explorer build/static/js/*.js"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
    "connect-api-mocker": "^1.11.0",
    "source-map-explorer": "^2.5.3"
  }
}

I' using react hoks (functions) and the classes. Maby there is a difference?

jmamadeu commented 2 weeks ago

Same issue here, none of the solutions worked for me

ansulagrawal commented 2 weeks ago

@jovana @jmamadeu I didn't find it as not working, yes when you try to upgrade it won't work but I have uninstall all node-modules and remove react-big-schedule from package.json and deleted the lock file and than install all package back and then install react-big-schedule it works.

jovana commented 2 weeks ago

Hi, I have tried to remove/delete al files completely. Retrive my code from git in a new folder and remove also yarn.lock run the install without react-big-schedule. Start dev, it worked. Now stop and installing the latest react-big-schedule version. Start dev, same error.

So the only version witch is working so fare is 4.4.1.

Thanks for helping me out.

ansulagrawal commented 2 weeks ago

Can you send me the package.json file as well as configuration file

jovana commented 2 weeks ago

Can you send me the package.json file as well as configuration file

The package file are in the post above. Witch configuration file you need?

ansulagrawal commented 2 weeks ago

You have create project with create react app or custom webpack config or vite?

jovana commented 2 weeks ago

No not use that anymore. Only have a package.json and then run yarn install.

jovana commented 2 weeks ago

@ansulagrawal Thanks for your update and help. I have tried a lot of things.

Delete all packages, clear the cache, reinstall:

rm -rf yarn.lock
rm -rf node_modules/
yarn cache clean
yarn install

But does not solve any issues. Probably some conflicts in the packages I use, but can not figure it out. Now I have rolled back to 4.4.1 witch is still working fine.

This is my package.json

{
  "name": "admin",
  "jest": {},
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@ant-design/pro-layout": "7.21.1",
    "@monaco-editor/react": "^4.6.0",
    "@phosphor-icons/react": "^2.1.7",
    "accounting-js": "^1.1.1",
    "antd": "5.21.6",
    "axios": "^1.7.7",
    "heic2any": "^0.0.4",
    "highcharts": "^11.4.8",
    "highcharts-react-official": "^3.2.1",
    "moment": "^2.29.1",
    "moment-timezone": "^0.5.46",
    "qrcode.react": "^4.1.0",
    "react": "^18.3.1",
    "react-big-schedule": "4.4.1",
    "react-beautiful-dnd": "^13.1.1",
    "react-collapsed": "^4.1.2",
    "react-datepicker": "^7.5.0",
    "react-dom": "^18.3.1",
    "react-gravatar": "^2.6.3",
    "react-hook-form": "^7.53.1",
    "react-intl": "^6.8.4",
    "react-moment": "^1.1.1",
    "react-pdf": "8.0.2",
    "react-quill": "^2.0.0",
    "react-router-dom": "^6.27.0",
    "react-scripts": "^5.0.1",
    "react-signature-canvas": "^1.0.6",
    "react-to-print": "^2.15.1",
    "uuid": "^11.0.2",
    "validator": "^13.12.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jest-environment-jsdom-sixteen",
    "eject": "react-scripts eject",
    "mockapi": "node ./mock-api/app.js",
    "analyze": "source-map-explorer build/static/js/*.js"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
    "connect-api-mocker": "^1.11.0",
    "source-map-explorer": "^2.5.3"
  }
}

I' using react hoks (functions) and the classes. Maby there is a difference?

This is the package.json file. Change this line "react-big-schedule": "4.4.1", to "react-big-schedule": "4.4.3" off course.

ansulagrawal commented 1 week ago

Can you try to use the vite configuration and check

itszakos commented 1 week ago

For me with create react app didn't work, but after I changed to vite it is working

ansulagrawal commented 1 week ago

Will check with the create react app and we pack bundles.

ansulagrawal commented 1 week ago

@jovana @itszakos @jmamadeu. I think have have fixed the issue. Can someone try by running npm install react-big-schedule@beta. If it works will push the code to master branch with stable release.

itszakos commented 1 week ago

@ansulagrawal react-big-schedule@beta is working now with create react app for me 👍 also please note that the latest react-dnd version is not working with the scheduler so I downgraded to 14.0.5 and it is working, maybe it is worth to display the supported version in the readme

ansulagrawal commented 1 week ago

You need to use 14.0.4 only else it won't work, and why do you need to install it?

itszakos commented 1 week ago

I'm using typescript and the wrapper is not exported in the d.ts

ansulagrawal commented 1 week ago

I will add in it thanks for suggesting

ansulagrawal commented 1 week ago

I think now i can merge the stable version as it's working fine.