question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No optimizations are happening

See original GitHub issue

Packages:

{
    "babel-plugin-styled-components": "^1.10.7",
    "dotenv-webpack": "^1.7.0",
    "file-loader": "^6.0.0",
    "image-trace-loader": "^1.0.2",
    "imagemin-gifsicle": "^7.0.0",
    "imagemin-mozjpeg": "^8.0.0",
    "imagemin-optipng": "^7.1.0",
    "imagemin-svgo": "^7.1.0",
    "jimp": "^0.10.1",
    "lqip-loader": "^2.2.0",
    "next-videos": "^1.1.4",
    "responsive-loader": "^1.2.0",
    "svg-sprite-loader": "^4.2.5",
    "webp-loader": "^0.6.0",
    "next-compose-plugins": "^2.2.0",
    "next-optimized-images": "^2.5.7"
  }

Build script:

next build && next export -o build/

Next config

// next.config.js
const withPlugins = require('next-compose-plugins');
const optimizedImages = require('next-optimized-images');
const withVideos = require('next-videos');
const Dotenv = require('dotenv-webpack');

const nextConfig = {
    webpack: (config, options) => {

        config.plugins.push(new Dotenv({ silent: true }));

        return config;
    },
};

module.exports = withPlugins([
    [optimizedImages, {}],
    [withVideos, {}],

    // your other plugins here

], nextConfig);

When requiring an image like so:

require("../assets/img/content/blog-header.jpg").default

and running

npm build

I still get the original image:

http://localhost:8000/_next/static/images/blog-header-e92e08032b49a33b9e710b97acbd569a.jpg

I’m expecting to get a webm image or at least a much smaller image but nothing seems to be happening.


When adding ?lqip to an image, I get

TypeError: Cannot read property '1' of null

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
jordyvandomselaarcommented, Apr 15, 2020

@durchanek makes sense. I’ll close this issue as I think it’s a PEBCAK =) Thanks for the help!

0reactions
durchanekcommented, Apr 15, 2020

@jordyvandomselaar Yeah, it will not, but you can use Modernizr together with a SASS mixin or a JSS function.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GCC Why Non Run Optimization All Time? - Stack Overflow
There are a few reasons. 1. Compilation takes longer time. For small and even medium sized projects, this is rarely an issue today....
Read more >
Optimize Options (Using the GNU Compiler Collection (GCC))
Without any optimization option, the compiler's goal is to reduce the cost of compilation and to make debugging produce the expected results.
Read more >
How to prevent optimization of a variable
If the variable is no longer in scope, it should be destroyed. If you want it to have a longer lifetime, move it...
Read more >
Arm Compiler for Embedded User Guide - Arm Developer
Arm® Compiler for Embedded performs several optimizations to reduce the code size and improve the ... Faster compile and build time, -O0 (no...
Read more >
Options That Control Optimization — gcc 6 documentation
Without any optimization option, the compiler's goal is to reduce the cost of compilation and to make debugging produce the expected results.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found