-
Notifications
You must be signed in to change notification settings - Fork 91
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
strange inline data uris with next 6 #20
Comments
Same for non-inline images, they contain that text. |
Hi @notatestuser But I now just set up a small new project with only next 6, this plugin and a few test images and everything is working as expected (for both inline and non-inline images, with and without the |
Hey sure @cyrilwanner, thanks for researching! we do use a few plugins already, those are: const withPlugins = require('next-compose-plugins');
const withCss = require('@zeit/next-css');
const withTranspile = require('@weco/next-plugin-transpile-modules');
const withSourceMaps = require('@zeit/next-source-maps');
const withOptimizedImages = require('next-optimized-images');
exports = module.exports = withPlugins([
[withCss],
[withTranspile],
[withSourceMaps],
[withOptimizedImages, {
imagesFolder: 'images',
imagesPublicPath: `${CDN_URL}/_next/static/images/`,
}],
], { we are using the plugin in two ways, one the normal way just in render(): <img
src={require('./Logo/logo-en.svg')}
alt={brand}
/> and in styled-components: const GraphicOK = styled.img.attrs({
src: require('./Status/statusOk.gif'),
})`
display: block;
...
`; |
Wait, I think I might have found what is doing it- config.module.rules.push({
test: /\.(ico|gif|png|jpg|jpeg|svg|webp|eot|ttf|woff|otf)$/,
use: [
'file-loader',
],
}); let me remove this and see what happens. |
Oops, it was the file-loader. we have quite a large next.config.js and it was hiding down at the bottom. sorry for the false alarm and I can confirm that it's now working as intended. 😄 There still seems to be an issue with a jest test breaking due to an image but that's a different topic. |
Hi @cyrilwanner this is a great idea, but having some issues getting it working. My inline images are being generated with data uris like this:
which, when decoded, contains text content like this:
which clearly isn't an image. Is this an incompatibility with next 6 situation I'm encountering here?
Any help appreciated!
fyi. just using
imagesFolder
andimagesPublicPath
config keys.The text was updated successfully, but these errors were encountered: