Closed MrRhodes closed 4 years ago
I've just encountered an issue were assetPrefix was undefined and was setting my image assets to be undefined/_next/static...
assetPrefix
undefined/_next/static...
I believe it is on this line when creating the new nextConfig https://github.com/twopluszero/next-images/blob/73b49921e870d4f1e75c32bf7d7c3269375af51b/index.js#L5
nextConfig
if nextConfig already has assetPrefix set as undefined it does not default to "" and then causes this to created as a string...
undefined
""
In my config i have the following:
assetPrefix: process.env.PUBLIC_URL,
...which is only set when I am deploying to prod, for local dev this env variable is... undefined
I'll expand on this later, i just wanted to log this issue now as I've resolved it for myself by defaulting in my config..
assetPrefix: process.env.PUBLIC_URL || '',
I've just encountered an issue were
assetPrefix
was undefined and was setting my image assets to beundefined/_next/static...
I believe it is on this line when creating the new
nextConfig
https://github.com/twopluszero/next-images/blob/73b49921e870d4f1e75c32bf7d7c3269375af51b/index.js#L5if
nextConfig
already has assetPrefix set asundefined
it does not default to""
and then causes this to created as a string...In my config i have the following:
...which is only set when I am deploying to prod, for local dev this env variable is...
undefined
I'll expand on this later, i just wanted to log this issue now as I've resolved it for myself by defaulting in my config..