Open SanskarSans opened 4 years ago
seems like its hard to get support from the team. Will look at next-images instead as i am short of time.
Receiving a similar warning (not error) for ttf
, txt
, and html
types.
If I don’t use next-optimized-images
the warning goes away.
What’s strange, though, is that despite the warning, the font, text, and html files seem to get loaded.
I ran into the same issue and the problem was not this library.
This is a webpack
error regarding how to handle different file types.
In my case, I was reading .md
files and processing them static alongside with grey-matter
and remark
. So far so good.
But then I added this lib and the warning appeared. That's because this lib is finding the special require
(such as require('/file.png?svg')
) through loaders and thus webpack
also found some unknown .md
files.
next-optimized-images
raw-loader
rule for webpack: config.module.rules.push(
{
test: /\.md$/, // your extension
use: 'raw-loader'
}
)
Hope it helps
Awesome, thanks @sospedra 🎉
For multiple file types:
config.module.rules.push({
test: /(\.ttf|\.html)$/,
use: 'raw-loader'
})
I'm experiencing same error, even i tried @sospedra suggestion, still, PWA will not generate when withOptimizeIMages is at the top like below
module.exports = withPlugins(
[withOptimizedImages, optimizedImagesConfig],
[
withPWA({
pwa: {
dest: "public",
},
}),
],
// [withOffline],
[withSass],
nextConfig
);
if i change the position, then ill encounter again the same error..
I am trying to configure my project with next-optimized-images for image part. However, I am getting the following error
This is my setup and its been two days and I have tried many solutions to no avail
I have following packages installed as well
I am importing or using the images in the below way
img: require("assets/images/banner-nav/everest.jpg"),
Did i miss anything to setup? please I am stuck since two days. Any help is highly appreciated.
Thanks