Skip to content
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

Nextron support for images.remotePatterns originally from next.config.js (Next.js) #392

Closed
bm777 opened this issue Aug 21, 2023 · 2 comments

Comments

@bm777
Copy link
Collaborator

bm777 commented Aug 21, 2023

How can I configure the external image URL source as we do in next.js (next.config.js) as following:

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: false,
  images:{
    remotePatterns: [
      {
        protocol: "https",
        hostname: "**"
      }
    ],
    minimumCacheTTL: 15000000,
  }
}

module.exports = nextConfig

This is the content I have in my next.config.js

module.exports = {
  webpack: (config, { isServer }) => {
    if (!isServer) {

    }

    return config;
  },
};
@AbdeenM
Copy link

AbdeenM commented Aug 24, 2023

Try the following package versions:

    "electron": "^21.4.4",
    "nextron": "^8.5.0",
    "next": "13.4.12",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",

Its abit tricky because support for next 13 and electron 22+ is not yet available on nextron but i have remotepatterns working for me with these versions.

You can also checkout this repo for an example, but i couldnt get it working tho

@bm777
Copy link
Collaborator Author

bm777 commented Aug 25, 2023

@AbdeenM Thanks for your reply.

I found a solution without changing my current package version.
I only have to add domains outside of the webpack function like this and it works.

module.exports = {
  images: {
    domains: ["lh3.googleusercontent.com"]
  },
  webpack: (config, {isServer, defaultLoaders}) => {
    if (!isServer) {
      
    }
    return config
    
  }
}

@bm777 bm777 closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants