-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Compilation error (the same filename for multiple chunks) when import an image twice with the same filename #18272
Comments
I am also seeing this after upgrading from 16.3 to 16.6 |
Seems like the hash got removed from the outputted file name. I think it might be related to #17763 |
Seems like it only happens with the dev server. The production builds continue to have the hash. cc @jbadeau |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
bump |
…#27159) Our assets are generated as flat assets in dist, which allows using assets from workspace libs. This prevents users from having different assets with the same filename (e.g. `foo/image.png` and `bar/image.png`). This will error out in the dev server with conflicting filenames. We cannot use `[path][name]` because of assets that are outside of the app folder (e.g. `../../libs/ui/src/assets/image.png`). Thus the best option is to include hash. Note: Also re-enabled the e2e tests for `react.test.ts` file since it is now using Playwright instead of Cypress. ## Current Behavior Assets with the same filename will error in dev-mode. ## Expected Behavior Assets with the same filename works. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #18272
…#27159) Our assets are generated as flat assets in dist, which allows using assets from workspace libs. This prevents users from having different assets with the same filename (e.g. `foo/image.png` and `bar/image.png`). This will error out in the dev server with conflicting filenames. We cannot use `[path][name]` because of assets that are outside of the app folder (e.g. `../../libs/ui/src/assets/image.png`). Thus the best option is to include hash. Note: Also re-enabled the e2e tests for `react.test.ts` file since it is now using Playwright instead of Cypress. ## Current Behavior Assets with the same filename will error in dev-mode. ## Expected Behavior Assets with the same filename works. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #18272 (cherry picked from commit 0710fea)
…nrwl#27159) Our assets are generated as flat assets in dist, which allows using assets from workspace libs. This prevents users from having different assets with the same filename (e.g. `foo/image.png` and `bar/image.png`). This will error out in the dev server with conflicting filenames. We cannot use `[path][name]` because of assets that are outside of the app folder (e.g. `../../libs/ui/src/assets/image.png`). Thus the best option is to include hash. Note: Also re-enabled the e2e tests for `react.test.ts` file since it is now using Playwright instead of Cypress. ## Current Behavior Assets with the same filename will error in dev-mode. ## Expected Behavior Assets with the same filename works. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes nrwl#18272
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
When I try to serve my project, I get this error
Expected Behavior
I should get no error; images should have different names.
GitHub Repo
https://github.com/shlajin/nx-multiple-chunks-bug-demo
Steps to Reproduce
I started with a brand new repo to illustrate the problem.
I added a library (no tests, not buildable, not publishable).
I added 2 different images into the following folders:
And added 2 files next to each of the images that simply import and re-export the image:
Then, in
libs/sample-library/src/index.ts
I re-exported my 2 files:To recap, I have 2 folders named
apple
andorange
, each folder contains apreview.png
file and one .ts file each. The *.ts file simply re-exports the image (obtains the image URL as per default behaviour), and theindex.ts
of the whole library re-exports the *.ts files.Now if I try to use the images in the app, e.g.
and run
I get
I attached a demo repo for your convenience.
Thank you!
Nx Report
Failure Logs
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: