-
Notifications
You must be signed in to change notification settings - Fork 42
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
NextJS - Failed to start Quarkus #603
Comments
@shivam-sharma7 didn't you just work with a NextJS project? I know I had it working last year with a NextJS project using NextJS 12. |
@melloware Not yet, busy with Horreum and seems issue is not related with next.js config @ia3andy must know |
@l2c0r3 can you put together a small reproducer using a simple nextjs app showing the issue? |
@melloware okay, I will do it tomorrow |
Confirmed! Here is the reproducer: I get the same error as you. |
With NextJS version 13.5.6 I have noticed the same thing: DEV mode works but the QuarkusIntegrationTests throws the same error as mentioned. |
@l2c0r3 found a workaround Juts add this to your application.properties.
That makes the PROD mode work. @ia3andy I htink there is something wrong with return new QuinoaConfigDelegate(super.override(delegate, packageJson, detectedDevScript, isCustomized)) {
@Override
public DevServerConfig devServer() {
return new DevServerConfigDelegate(super.devServer()) {
@Override
public Optional<String> indexPage() {
// In Dev mode Next.js serves everything out of root "/" but in PRD mode it is the
// normal "/index.html".
return Optional.of(super.indexPage().orElse("/"));
}
};
}
}; |
Many thanks for the quick answers and analyse @melloware! Unfortunately, the workaround only works to a limited extent: I have noticed this with my project as well as your reproducer. |
Yep I was just trying to get your past your prd mode issue. The real issue is a bug in |
Ah I understand. Many thanks to you |
Also created #606 which can use the same reproducer from this ticket. |
Thanks for reporting this @l2c0r3, the error you've catched is just the tip of the iceberg as this could affect any production apps using the configured devserver index page name (instead of the prod one). To mitigate this issue:
|
@all-contributors add @l2c0r3 for bug |
I've put up a pull request to add @l2c0r3! 🎉 |
Describe the bug
When I create a fresh NextJS application with Quarkus, the DEV mode works without any problems.
The QuarkusTests also work, but I have the following errors with the QuarkusIntegrationTests:
2024-01-03 14:37:07,674 ERROR [io.qua.run.Application] (main) Failed to start application (with profile [prod]): java.lang.RuntimeException: Failed to start quarkus at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source) at io.quarkus.runtime.Application.start(Application.java:101) at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111) at io.quarkus.runtime.Quarkus.run(Quarkus.java:71) at io.quarkus.runtime.Quarkus.run(Quarkus.java:44) at io.quarkus.runtime.Quarkus.run(Quarkus.java:124) at io.quarkus.runner.GeneratedMain.main(Unknown Source) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:61) at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:32) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:48) at java.base/java.lang.String.charAt(String.java:1512) at io.vertx.ext.web.handler.impl.StaticHandlerImpl.setIndexPage(StaticHandlerImpl.java:635) at io.quarkiverse.quinoa.QuinoaUIResourceHandler.createStaticHandler(QuinoaUIResourceHandler.java:67) at io.quarkiverse.quinoa.QuinoaUIResourceHandler.<init>(QuinoaUIResourceHandler.java:37) at io.quarkiverse.quinoa.QuinoaRecorder.quinoaHandler(QuinoaRecorder.java:41) at io.quarkus.deployment.steps.QuinoaProcessor$runtimeInit397778252.deploy_0(Unknown Source) at io.quarkus.deployment.steps.QuinoaProcessor$runtimeInit397778252.deploy(Unknown Source) ... 13 more
Package.json:
{ "name": "lcm-webui", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "react": "^18", "react-dom": "^18", "next": "14.0.4" }, "devDependencies": { "typescript": "^5", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", "postcss": "^8", "tailwindcss": "^3.3.0", "eslint": "^8", "eslint-config-next": "14.0.4" } }
next.config.js
const nextConfig = { output: 'export', } module.exports = nextConfig
Quinoa version
2.3.1
Quarkus version
3.6.4
Build / Runtime
Next.js
Package Manager
NPM
The text was updated successfully, but these errors were encountered: