Closed therk closed 3 years ago
I have the same issue. Need to resolve it.
Please, fix it!
I have the same issue. Need to resolve it.
It works with img
but not with native NextJS Image
Mine too fails w/ NextJS Image, but works with img
Is this just me or is this still an issue?
This is still an issue. Please can someone have a look?
Steps to reproduce:
import myImage from './assets/my-image.png'
export const MyComp = () =>
5. Import the React component in your Next.js app. Image will appear broken - probably like this:
Providing absolute url for NextImage worked for me.
<NextImage src="http://localhost:4200/assets/image.png" />
// <NextImage src={`${NX_APP_URL}/assets/image.png`} />
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
Image is not found
Expected Behavior
Following the instruction on "9. Shared assets library and nx.json - Nx Workspaces Course, by Nrwl" https://www.youtube.com/watch?v=LYjX2V-eQa8 The image should be found.
Steps to Reproduce
Created a test project to reproduce the issue https://github.com/therk/nx-test-next-with-assets In the test project, there is ui lib with the About component and assets folder with about.png file. In the workspace.json added the following section under build:
Int the About component, try to reference the image using:
<img src="/assets/ui/about.png" alt="About"></img>
Environment
Node : 15.1.0 OS : darwin x64 yarn : 1.22.4
nx : Not Found @nrwl/angular : Not Found @nrwl/cli : 11.1.5 @nrwl/cypress : 11.1.5 @nrwl/devkit : 11.1.5 @nrwl/eslint-plugin-nx : 11.1.5 @nrwl/express : Not Found @nrwl/jest : 11.1.5 @nrwl/linter : 11.1.5 @nrwl/nest : Not Found @nrwl/next : 11.1.5 @nrwl/node : Not Found @nrwl/react : 11.1.5 @nrwl/schematics : Not Found @nrwl/tao : 11.1.5 @nrwl/web : 11.1.5 @nrwl/workspace : 11.1.5 typescript : 4.0.5