-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use with Next.js ? #103
Comments
I'm trying to use it with Next.js following the directions from the Configuration section (Webpack and React) and what I got: maybe I missing something 🤔, check out my repo (webpack config) |
Getting the same issue with |
Also same issue and I find one #46 after reading , still have no idea how to solve this |
Thanks to @enpitsuLin 's comment, I managed to make it works, you will need to:
module.exports = {
reactStrictMode: true,
webpack(config) {
config.plugins.push(
require('unplugin-icons/webpack')({
compiler: 'jsx',
jsx: 'react',
extension: 'jsx',
}),
);
return config;
},
};
import IconAccessibility from "~icons/carbon/accessibility.jsx";
import IconAccountBox from "~icons/mdi/account-box.jsx"; I not sure whether this is a desired behavior or it should be changed, but this is how it work with next.js |
Ah, we just need to add the extension ( |
Update README.md to add instructions for Next.js RELATED TO unplugin#103
Had to update from |
Do you guys also know how to make the Auto Importing feature work with Next.js ? Or is it not technically possible ? |
Haven’t tried myself yet, but I think it has something to do with getting the icons for SSR during build-time being quite tricky. Probably not the best way to paste this here, but at least you can see it without discord: Hope it nudges you in the right direction. Please tell us if it worked or not and what you did 😃 |
No description provided.
The text was updated successfully, but these errors were encountered: