-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
I'm having trouble loading custom fonts in CSS in a new app created using CRA.
I added the "mdi" package (for the Material Design Icons font) and added "@import '~mdi/css/materialdesignicons.css';" in the "index.css" file. When I run/build using CRA, everything works fine. However, when I run with Storybook, I get the following error (repeated multiple times for each of the font files... ttf, woff, woff2, svg):
ERROR in ...node_modules/mdi/fonts/materialdesignicons-webfont.ttf?v=2.0.46
Module parse failed: Unexpected character ' ' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
@ ...node_modules/@storybook/react/node_modules/css-loader?{"importLoaders":1}!...node_modules/@storybook/react/node_modules/postcss-loader/lib?{"ident":"postcss","plugins":[null,null]}!...node_modules/mdi/css/materialdesignicons.css 6:512-572
@ ...node_modules/@storybook/react/node_modules/css-loader?{"importLoaders":1}!...node_modules/@storybook/react/node_modules/postcss-loader/lib?{"ident":"postcss"}!./src/index.css
@ ./src/index.css
@ ./.storybook/config.js
@ multi ...node_modules/@storybook/react/dist/server/config/polyfills.js ...node_modules/@storybook/react/dist/server/config/globals.js ...node_modules/webpack-hot-middleware/client.js?reload=true ./.storybook/config.js
I don't have any custom webpack configs, I'm just using the defaults from CRA. Is anyone else having problems loading custom fonts? Could this be something unique to Material Design Icons?