Esri / calcite-react

DEPRECATED - DO NOT USE
https://calcite-react.netlify.com
Apache License 2.0
51 stars 14 forks source link

TypeError w/ new app #337

Open mpayson opened 4 years ago

mpayson commented 4 years ago

Expected Behavior

Can add a component

Current Behavior

Calcite-react throws a type error when creating a new app with create-react-app and replacing index.js / App.js with the calcite-react getting started snippets

Context + Screenshots

Error message

Uncaught TypeError: (0 , _helpers.fontSize) is not a function
    at Object../node_modules/calcite-react/CalciteThemeProvider/CalciteThemeProvider.js (CalciteThemeProvider.js:97)
    at __webpack_require__ (bootstrap:785)
    at fn (bootstrap:150)
    at Object../node_modules/calcite-react/CalciteThemeProvider/index.js (index.js:25)
    at __webpack_require__ (bootstrap:785)
    at fn (bootstrap:150)
    at Object../node_modules/calcite-react/utils/helpers.js (helpers.js:10)
    at __webpack_require__ (bootstrap:785)
    at fn (bootstrap:150)
    at Object../node_modules/calcite-react/Button/Button-styled.js (Button-styled.js:10)
    at __webpack_require__ (bootstrap:785)
    at fn (bootstrap:150)
    at Object../node_modules/calcite-react/Button/Button.js (Button.js:12)
    at __webpack_require__ (bootstrap:785)
    at fn (bootstrap:150)
    at Object../node_modules/calcite-react/Button/index.js (index.js:19)
    at __webpack_require__ (bootstrap:785)
    at fn (bootstrap:150)
    at Module../src/App.js (index.css:3)
    at __webpack_require__ (bootstrap:785)
    at fn (bootstrap:150)
    at Module../src/index.js (index.css?e32c:37)
    at __webpack_require__ (bootstrap:785)
    at fn (bootstrap:150)
    at Object.1 (serviceWorker.js:137)
    at __webpack_require__ (bootstrap:785)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1

Your Environment

package.json dependencies

    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "calcite-react": "^0.47.0",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-scripts": "3.3.0"
mpayson commented 4 years ago

It works in v0.46.0 so looks like the error was introduced fro v0.47.0

mpayson commented 4 years ago

Another update, this appears to happen when App.js is imported before CalciteThemeProvider in index.js

codylawson commented 4 years ago

@mpayson Thanks for recording this bug, I saw this happening on another project but wasn't able to reproduce. Knowing the import order makes a difference would explain why. I'll continue to look into this.