Skip to content

Tag: next.js

Using baseUrl in jsconfig.json is not working with Next.js

jsconfigerror is an example repository showing the jsconfig is not working. I have the following set inside my jsconig.json file: However, when I do an import, it fails: Folder Structure pages/index.js How can I get baseUrl to work with Next.js? Answer Since Next.js 9.4, Next.js automatically supports the tsc…

How to configure next.config.js file on right way

In my next.config.js I have the following configuration: Last thing which I need to add here is next-fonts plugin. I am not sure how to export withFounts in the right way. I need next-fonts plugin to be able to use ‘fonts’ icons. Answer You can do this: You can try to use next-compose

How to import SVG into Next.js component?

I am trying to import an SVG image from file into a Next.js component. In the assets folder I have google.svg (icon): I need to import that SVG inside of this inside of the Next.js component: I installed this package: https://www.npmjs.com/package/next-images and set configuration based on that documentation …

Dynamic Import Node Module With Next.js

I was getting an error of window undefined when using react-leaflet node module because it relies on window and of course SSR does not support window. I found next/dynamic, however, all the examples I found show how to import a component and not a node module. Is it possible to include a node module and if so…