calcite-react
calcite-react copied to clipboard
TypeError w/ new app
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
- Version used: 0.47.0
- Browser Name and version: chrome / firefox latest
- Operating System and version (desktop or mobile): NA
- Link to your project: NA
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"
It works in v0.46.0
so looks like the error was introduced fro v0.47.0
Another update, this appears to happen when App.js
is imported before CalciteThemeProvider
in index.js
@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.