这是indexloc提供的服务,不要输入任何密码
Skip to content

Could not optimize image (TypeError: Only absolute URLs are supported) #108

@aredean

Description

@aredean

Hi,

I have some errors when trying to use image optimization, even I have already created process.env.
Image optimization always using my local path.

This is my plugin settings.

eleventyConfig.addPlugin(ampPlugin, {
      ampRuntimeHost:
        process.env.ENV === 'prod' ? 'https://mydomain.com' : 'http://localhost:8080',
      imageOptimization: true,
      validation: false,
    });

The error :

AMP Img Optimization WARNING Could not optimize image ({{ my local path }}\assets\{{ myfilename }}.png, 820w): TypeError: Only absolute URLs are supported

Is any wrong with the setup?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions