JavaScript generated react apps create and index.html
that references main.tsx
instead of main.jsx
, and create .js files not .jsx files which generates errors in build target
#20810
Labels
Current Behavior
[vite]: Rollup failed to resolve import "/src/main.tsx" from "path/to/workspace/ui/apps/admin/index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
Expected Behavior
yarn run v1.22.19
$ path/to/workspace/ui/node_modules/.bin/nx run admin:build --configuration=development
vite v5.0.10 building for development...
✓ 33 modules transformed.
../../dist/apps/admin/index.html 0.48 kB │ gzip: 0.30 kB
../../dist/apps/admin/assets/index-f0mNRiTD.css 0.00 kB │ gzip: 0.02 kB
../../dist/apps/admin/assets/index-NYD0XF7l.js 167.40 kB │ gzip: 51.96 kB
✓ built in 1.38s
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Nx read the output from the cache instead of running the command for 1 out of 1 tasks.
View logs and run details at https://nx.app/runs/OuB24bgKAY
Done in 0.44s.
GitHub Repo
No response
Steps to Reproduce
npx create-nx-workspace --pm yarn --js
Nx Report
Failure Logs
Package Manager Version
yarn 1.22.19
Operating System
Additional Information
I renamed the .js files to .jsx, and changed
main.tsx
tomain.jsx
in the index.html file, that makes it work, i think the problem is in the generator, so I don't want each time to do the same process, any help will be appreciated. Thank you in advance.The text was updated successfully, but these errors were encountered: