1

I'm trying to use React Rainbow Components with Next.js (TypeScript) but I could not import font, so I used webpack with url-loader.

For some reason I keep getting the error SyntaxError: Invalid or unexpected token error - D:\Git Repository\project\node_modules\react-rainbow-components\components\Application\fonts\Lato-Black\Lato-Black.eot:1 ��☺ inside the eot file from their fonts.

Here is my webpack config in next.config.js:

module.exports = {
 webpack: (config, options) => {
 config.module.rules.push({ 
 test: /\.(png|woff|woff2|eot|ttf|svg)$/,
 use: [
 {
 loader: 'url-loader?limit=100000'
 },
 ],
 })
 return config
 },
}

Any idea what I did wrong? Or is it a problem inside their font itself?

Zsolt Meszaros
23.3k19 gold badges60 silver badges70 bronze badges
asked Jan 10, 2021 at 21:24

1 Answer 1

1

This was already fixed in the version, if you update the version of react-rainbow-components to v1.24.1, the fonts were moved to a CDN. Here are the release-notes https://github.com/nexxtway/react-rainbow/releases

answered Mar 2, 2021 at 17:56
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.