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

PiT 24.5: routing fails making impossible to run a downloaded hybrid application from start #19870

Closed
Tracked by #6634
manolo opened this issue Sep 3, 2024 · 2 comments · Fixed by #19878
Closed
Tracked by #6634

Comments

@manolo
Copy link
Member

manolo commented Sep 3, 2024

Description of the bug

When downloading the test-hybrid preset from start.vaadin.com it does not work and reports this error:

[plugin:vite:import-analysis] Failed to resolve import "react-router-dom" from "src/main/frontend/generated/jar-resources/ReactRouterOutletElement.tsx". Does the file exist?
/Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/src/main/frontend/generated/jar-resources/ReactRouterOutletElement.tsx:1:23
1  |  var _jsxFileName = "/Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/src/main/frontend/generated/jar-resources/ReactRouterOutletElement.tsx";
2  |  import { Outlet } from "react-router-dom";
   |                          ^
3  |  import { ReactAdapterElement } from "Frontend/generated/flow/ReactAdapter.js";
4  |  import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
    at TransformPluginContext._formatError (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:49159:41)
    at TransformPluginContext.error (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:49154:16)
    at normalizeUrl (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:63936:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:64068:39
    at async Promise.all (index 0)
    at async TransformPluginContext.transform (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:63995:7)
    at async PluginContainer.transform (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:49000:18)
    at async loadAndTransform (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:51822:27)
    at async viteTransformMiddleware (file:///Users/manolo/Github/platform/platform-in-test-script/tmp/test-hybrid/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:61776:24

Expected behavior

it works

Minimal reproducible example

  1. Download the hybrid app from start.vaadin.com, and run it
curl -s -f 'https://start.vaadin.com/dl?&preset=test-hybrid&projectName=test-hybrid' -o test-hybrid.zip
unzip test-hybrid.zip
cd test-hybrid
perl -pi -e 's|<java.version>21</java.version>|<java.version>17</java.version>|' pom.xml
./mvnw
  1. visit the app and see the error in console

Versions

  • Vaadin / Flow version: 24.5.0.alpha14
@ZheSun88
Copy link
Contributor

ZheSun88 commented Sep 3, 2024

Note: this app is using @vaadin/router and the import can be found from index.ts.

@mshabarov mshabarov moved this to 🔖 High Priority (P1) in Vaadin Flow bugs & maintenance (Vaadin 10+) Sep 3, 2024
@mshabarov mshabarov moved this to 🪵Product backlog in Vaadin Flow ongoing work (Vaadin 10+) Sep 3, 2024
@mshabarov mshabarov self-assigned this Sep 3, 2024
@mshabarov mshabarov moved this from 🪵Product backlog to 🟢Ready to Go in Vaadin Flow ongoing work (Vaadin 10+) Sep 3, 2024
caalador added a commit that referenced this issue Sep 3, 2024
Remove reactOutlet module
if we are not running react,
but are using Vaadin Router
inferred from index.ts

Fixes #19870
@github-project-automation github-project-automation bot moved this from 🔖 High Priority (P1) to ✅ Closed in Vaadin Flow bugs & maintenance (Vaadin 10+) Sep 4, 2024
@github-project-automation github-project-automation bot moved this from 🟢Ready to Go to Done in Vaadin Flow ongoing work (Vaadin 10+) Sep 4, 2024
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha15 and is also targeting the upcoming stable 24.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment