creativetimofficial / ct-material-dashboard-pro-react

React version of Material Dashboard Pro
135 stars 26 forks source link

[Bug] compile error #332

Open ktwbc opened 7 months ago

ktwbc commented 7 months ago

Version

1.0.2

Reproduction link

https://example.com

Operating System

macos

Device

macbook pro

Browser & Version

webstorm IDE latest

Steps to reproduce

  1. Just trying to run build TS2339: Property 'palette' does not exist on type 'Theme | undefined'. 19 | 20 | export default styled(Box)(({ theme, ownerState }: { theme?: Theme; ownerState: any }) => {

    21 | const { palette, typography, borders, functions } = theme; | ^^^^^^^ 22 | const { color } = ownerState; 23 | 24 | const { white, gradients } = palette;

What is expected?

should compile

What is actually happening?

breaks on compile


Solution

Additional comments

ktwbc commented 7 months ago

As a test I downloaded a fresh copy of material-dashboard-2-pro-react-v1.0.2, ran pnpm install for the packages on node 18 and then attempted pnpm build and got the error below -- literally nothing but download, install packages and attempt build

Screenshot 2024-01-27 at 11 33 35

Creating an optimized production build... [BABEL] Note: The code generator has deoptimised the styling of /Users/kris/Downloads/material-dashboard-2-pro-react-v1.0.2 2/src/assets/images/illustrations/pattern-tree.svg as it exceeds the max of 500KB. [BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB. Failed to compile.

TS2307: Cannot find module 'prop-types' or its corresponding type declarations. 17 | 18 | // prop-types is a library for typechecking of props

19 | import PropTypes from "prop-types"; | ^^^^^^^^^^^^ 20 | 21 | // draft-js 22 | import { EditorState } from "draft-js";

 ELIFECYCLE  Command failed with exit code 1.

Process finished with exit code 1