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

Node 17 built with openssl < 3 does not work with Vaadin 21.0.8+ #12649

Closed
craigotis opened this issue Dec 29, 2021 · 21 comments · Fixed by #12675
Closed

Node 17 built with openssl < 3 does not work with Vaadin 21.0.8+ #12649

craigotis opened this issue Dec 29, 2021 · 21 comments · Fixed by #12675

Comments

@craigotis
Copy link

craigotis commented Dec 29, 2021

Description of the bug

I downloaded a starter Flow 22 project from https://start.vaadin.com/app/, but a clean project fails on ./mvnw with:

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Dec 29 07:27:00 EST 2021
There was an unexpected error (type=Internal Server Error, status=500).
java.lang.IllegalStateException: Webpack exited prematurely
com.vaadin.flow.server.ServiceException: java.lang.IllegalStateException: Webpack exited prematurely
	at com.vaadin.flow.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1616)
	at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1579)
	at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:299)
	at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:109)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:711)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:353)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
	at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:141)
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177)
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:895)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1732)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.IllegalStateException: Webpack exited prematurely
	at com.vaadin.base.devserver.AbstractDevServerRunner.doStartDevModeServer(AbstractDevServerRunner.java:220)
	at com.vaadin.base.devserver.AbstractDevServerRunner.runOnFutureComplete(AbstractDevServerRunner.java:172)
	at com.vaadin.base.devserver.AbstractDevServerRunner.lambda$new$0(AbstractDevServerRunner.java:163)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

There's no further/more detailed stack trace that I can find.

Expected behavior

The application should start.

Minimal reproducible example

  1. Visit https://start.vaadin.com/app/
  2. Under Settings, change Vaadin version to 22
  3. Download project
  4. Start with ./mvnw
  5. Browser launches with stacktrace

Versions

  • Vaadin / Flow version: 22.0.2
  • Java version: 11
  • OS version: macOS 12.1
@Artur-
Copy link
Member

Artur- commented Dec 29, 2021

Do you have Node 17 installed?

@craigotis
Copy link
Author

@Artur- Yep, seems that way:

➜  my-project git:(main) ✗ node -v
v17.3.0

@craigotis
Copy link
Author

craigotis commented Dec 29, 2021

Reverting to Node 16 seems to have resolved the issue, I found these seemingly-related tickets suggesting it's a compatibility bug between Webpack and Node 17:

microsoft/vscode#136599

webpack/webpack#14532

@Nyamkhuub
Copy link

@craigotis did you solve this issue?
I have a same issue with you. I tried to downgrade my node version to 16. 13.1 (LTS). But it's still doesn't work... :( sad ...
Do you have any solution?

@Nyamkhuub
Copy link

@Artur- any idea?

@Artur-
Copy link
Member

Artur- commented Jan 3, 2022

How can this be reproduced? If I take a Vaadin 22 project from start.vaadin.com and run it with Node 17.3.0, it works fine

@Nyamkhuub
Copy link

@Artur- First, sorry about that. And I fixed that issue by changing my node version to 17.3.0. This issue was node version related problem. this has to be closed ...

@oflege
Copy link

oflege commented Jan 4, 2022

To reproduce:
git clone https://github.com/vaadin/base-starter-spring-gradle
cd base-starter-spring-gradle
LOGGING_LEVEL_COM_VAADIN_BASE=TRACE ./gradlew bootRun

Log ends with

------------------ Starting Frontend compilation. ------------------
2022-01-04 08:36:21.886 DEBUG 68414 --- [onPool-worker-1] c.v.b.devserver.AbstractDevServerRunner  :
/usr/local/bin/node \
    ./node_modules/webpack-dev-server/bin/webpack-dev-server.js \
    --config \
    ./webpack.config.js --port 56574 \
    --watch-options-stdin --devtool=eval-source-map \
    --mode=development

2022-01-04 08:36:21.937  INFO 68414 --- [onPool-worker-1] c.v.b.devserver.AbstractDevServerRunner  : Running Webpack to compile frontend resources. This may take a moment, please stand by...
2022-01-04 08:36:21.952  INFO 68414 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : /usr/local/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

and the webpack server will not be running.
--openssl-legacy-provider is no longer supported in node 17.3.0, so
com.vaadin.base.devserver.WebpackHandler#updateServerStartupEnvironment is wrong with
/usr/local/bin/node --version = v17.3.0

@vt512
Copy link

vt512 commented Jan 4, 2022

By the way:
It works until Vaadin 21.0.7. Starting from 21.0.8 it fails.

@Artur-
Copy link
Member

Artur- commented Jan 4, 2022

git clone https://github.com/vaadin/base-starter-spring-gradle
cd base-starter-spring-gradle
LOGGING_LEVEL_COM_VAADIN_BASE=TRACE ./gradlew bootRun

Running this with Node 17.3.0 on a mac results in

------------------ Starting Frontend compilation. ------------------
2022-01-04 09:55:24.767 DEBUG 13193 --- [onPool-worker-1] c.v.b.devserver.AbstractDevServerRunner  : 
/Users/artur/.nvm/versions/node/v17.3.0/bin/node \ 
    ./node_modules/webpack-dev-server/bin/webpack-dev-server.js \ 
    --config \ 
    ./webpack.config.js --port 62919 \ 
    --watch-options-stdin --devtool=eval-source-map \ 
    --mode=development 

2022-01-04 09:55:24.794  INFO 13193 --- [onPool-worker-1] c.v.b.devserver.AbstractDevServerRunner  : Running Webpack to compile frontend resources. This may take a moment, please stand by...
2022-01-04 09:55:26.034  INFO 13193 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [webpack-dev-server] Project is running at:
2022-01-04 09:55:26.036  INFO 13193 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [webpack-dev-server] Loopback: http://localhost:62919/

@vt512
Copy link

vt512 commented Jan 4, 2022

Artur, this is my output with Vaadin 21.0.7:

------------------ Starting Frontend compilation. ------------------
2022-01-04 09:35:45.176  INFO 25666 --- [onPool-worker-3] c.v.base.devserver.DevModeHandlerImpl    : Running webpack to compile frontend resources. This may take a moment, please stand by...
ℹ 「wds」: Project is running at http://localhost:35123/webpack-dev-server/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/ulrich/tmp/testac/target/META-INF/VAADIN/webapp, src/main/webapp
<i> [FlowIdPlugin] Serving the 'stats.json' file dynamically.
ℹ 「wdm」: Hash: ef95f837acbe95c5ebc0
Version: webpack 4.46.0
Time: 3542ms
Built at: 04.01.2022 09:35:50
                                                                  Asset       Size        Chunks                                Chunk Names
                    VAADIN/build/vaadin-0-5815a1e100374590c9ea.cache.js   16.2 MiB             0  [emitted] [immutable]  [big]  
                    VAADIN/build/vaadin-1-cef5d58883f84478e139.cache.js    499 KiB             1  [emitted] [immutable]         
                    VAADIN/build/vaadin-2-25cd85c3b420560f3de5.cache.js   21.7 KiB             2  [emitted] [immutable]         
                    VAADIN/build/vaadin-3-753c44b1eaeef89fd693.cache.js    335 KiB             3  [emitted] [immutable]         
               VAADIN/build/vaadin-bundle-8049068bd0ee2c21005a.cache.js   1.41 MiB        bundle  [emitted] [immutable]         bundle
         VAADIN/build/vaadin-devmodeGizmo-b6677ccbb1d5947d3c41.cache.js    189 KiB  devmodeGizmo  [emitted] [immutable]         devmodeGizmo
   VAADIN/static/line-awesome/dist/line-awesome/fonts/la-brands-400.eot    153 KiB                [emitted]                     
   VAADIN/static/line-awesome/dist/line-awesome/fonts/la-brands-400.svg    906 KiB                [emitted]                     
   VAADIN/static/line-awesome/dist/line-awesome/fonts/la-brands-400.ttf    152 KiB                [emitted]                     
  VAADIN/static/line-awesome/dist/line-awesome/fonts/la-brands-400.woff   96.4 KiB                [emitted]                     
 VAADIN/static/line-awesome/dist/line-awesome/fonts/la-brands-400.woff2   82.8 KiB                [emitted]                     
  VAADIN/static/line-awesome/dist/line-awesome/fonts/la-regular-400.eot   33.1 KiB                [emitted]                     
  VAADIN/static/line-awesome/dist/line-awesome/fonts/la-regular-400.svg    111 KiB                [emitted]                     
  VAADIN/static/line-awesome/dist/line-awesome/fonts/la-regular-400.ttf   32.9 KiB                [emitted]                     
 VAADIN/static/line-awesome/dist/line-awesome/fonts/la-regular-400.woff   15.1 KiB                [emitted]                     
VAADIN/static/line-awesome/dist/line-awesome/fonts/la-regular-400.woff2   12.6 KiB                [emitted]                     
    VAADIN/static/line-awesome/dist/line-awesome/fonts/la-solid-900.eot    221 KiB                [emitted]                     
    VAADIN/static/line-awesome/dist/line-awesome/fonts/la-solid-900.svg    902 KiB                [emitted]                     
    VAADIN/static/line-awesome/dist/line-awesome/fonts/la-solid-900.ttf    221 KiB                [emitted]                     
   VAADIN/static/line-awesome/dist/line-awesome/fonts/la-solid-900.woff    122 KiB                [emitted]                     
  VAADIN/static/line-awesome/dist/line-awesome/fonts/la-solid-900.woff2   94.5 KiB                [emitted]                     
                                                             index.html  685 bytes                [emitted]                     
                                                          manifest.json    2.8 KiB                [emitted]                     
                                                                  sw.js    746 KiB                [emitted]                     
Entrypoint bundle = VAADIN/build/vaadin-bundle-8049068bd0ee2c21005a.cache.js
Entrypoint devmodeGizmo = VAADIN/build/vaadin-devmodeGizmo-b6677ccbb1d5947d3c41.cache.js
[../node_modules/.pnpm/@lit/reactive-element@1.0.2/node_modules/@lit/reactive-element/decorators/custom-element.js] 364 bytes {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/@lit/reactive-element@1.0.2/node_modules/@lit/reactive-element/decorators/event-options.js] 280 bytes {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/@lit/reactive-element@1.0.2/node_modules/@lit/reactive-element/decorators/property.js] 572 bytes {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/@lit/reactive-element@1.0.2/node_modules/@lit/reactive-element/decorators/query-all.js] 388 bytes {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/@lit/reactive-element@1.0.2/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js] 603 bytes {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/@lit/reactive-element@1.0.2/node_modules/@lit/reactive-element/decorators/query-async.js] 392 bytes {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/@lit/reactive-element@1.0.2/node_modules/@lit/reactive-element/decorators/query.js] 612 bytes {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/@lit/reactive-element@1.0.2/node_modules/@lit/reactive-element/decorators/state.js] 225 bytes {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/@lit/reactive-element@1.0.2/node_modules/@lit/reactive-element/reactive-element.js] 5.89 KiB {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/lit@2.0.0/node_modules/lit/decorators.js] 525 bytes {bundle} {devmodeGizmo} [built]
[../node_modules/.pnpm/lit@2.0.0/node_modules/lit/index.js] 122 bytes {bundle} {devmodeGizmo} [built]
[../target/flow-frontend/VaadinDevmodeGizmo.js] 37 KiB {devmodeGizmo} [built]
[../target/index.ts] 1.43 KiB {bundle} [built]
[./generated/theme.js] 110 bytes {bundle} [built]
[./generated/vaadin.ts] 89 bytes {bundle} [built]
    + 648 hidden modules

LOG from InjectManifest
<i> The service worker at sw.js will precache
<i>         22 URLs, totaling 22.7 MB.
Child HtmlWebpackCompiler:
     1 asset
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
    [../node_modules/.pnpm/html-webpack-plugin@4.5.1_webpack@4.46.0/node_modules/html-webpack-plugin/lib/loader.js!./index.html] 793 bytes {HtmlWebpackPlugin_0} [built]
Child InjectManifest:
     1 asset
    Entrypoint InjectManifest = sw.js
    [../node_modules/.pnpm/workbox-core@6.2.0/node_modules/workbox-core/_private.js] 1.4 KiB {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-core@6.2.0/node_modules/workbox-core/_version.js] 89 bytes {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-core@6.2.0/node_modules/workbox-core/cacheNames.js] 1.25 KiB {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-core@6.2.0/node_modules/workbox-core/clientsClaim.js] 513 bytes {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-core@6.2.0/node_modules/workbox-core/copyResponse.js] 2.4 KiB {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-core@6.2.0/node_modules/workbox-core/index.js] 935 bytes {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-core@6.2.0/node_modules/workbox-core/index.mjs] 27 bytes {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-core@6.2.0/node_modules/workbox-core/registerQuotaErrorCallback.js] 1.1 KiB {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-precaching@6.2.0/node_modules/workbox-precaching/index.js] 1.51 KiB {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-precaching@6.2.0/node_modules/workbox-precaching/index.mjs] 27 bytes {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-routing@6.4.2/node_modules/workbox-routing/index.js] 695 bytes {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-routing@6.4.2/node_modules/workbox-routing/index.mjs] 27 bytes {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-strategies@6.4.2/node_modules/workbox-strategies/index.js] 862 bytes {InjectManifest} [built]
    [../node_modules/.pnpm/workbox-strategies@6.4.2/node_modules/workbox-strategies/index.mjs] 27 bytes {InjectManifest} [built]
    [../target/sw.ts] 3.03 KiB {InjectManifest} [built]
        + 79 hidden modules
ℹ 「wdm」: Compiled successfully.

----------------- Frontend compiled successfully. -----------------

N2022-01-04 09:35:50.510  INFO 25666 --- [onPool-worker-3] c.v.base.devserver.DevModeHandlerImpl    : Started webpack-dev-server. Time: 5621ms
o issues found.
ℹ 「wdm」: Compiling...
ℹ 「wdm」: wait until bundle finished: /manifest.json
<i> [FlowIdPlugin] Serving the 'stats.json' file dynamically.
⚠ 「wdm」: Hash: ef95f837acbe95c5ebc0
Version: webpack 4.46.0
Time: 150ms
Built at: 04.01.2022 09:35:50
        Asset       Size  Chunks             Chunk Names
   index.html  685 bytes          [emitted]  
manifest.json  662 bytes          [emitted]  
        sw.js    744 KiB          [emitted]  
 + 6 hidden assets
Entrypoint bundle = VAADIN/build/vaadin-bundle-8049068bd0ee2c21005a.cache.js
Entrypoint devmodeGizmo = VAADIN/build/vaadin-devmodeGizmo-b6677ccbb1d5947d3c41.cache.js
[./generated/theme-testac.generated.js] 4.69 KiB {bundle} [built]
    + 644 hidden modules

LOG from InjectManifest
<i> The service worker at sw.js will precache
<i>         7 URLs, totaling 19.5 MB.

WARNING in InjectManifest has been called multiple times, perhaps due to running webpack in --watch mode. The precache manifest generated after the first call may be inaccurate! Please see https://github.com/GoogleChrome/workbox/issues/1790 for more information.
Child HtmlWebpackCompiler:
     1 asset
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
       1 module
Child InjectManifest:
     1 asset
    Entrypoint InjectManifest = sw.js
       94 modules
ℹ 「wdm」: Compiled with warnings.

----------------- Frontend compiled successfully. -----------------

No issues found.

And with Vaadin 21.0.8 the output ends with the node error message:

2022-01-04 09:23:30.189  INFO 24620 --- [onPool-worker-3] c.v.base.devserver.DevModeHandlerImpl    : Starting webpack-dev-server

------------------ Starting Frontend compilation. ------------------
2022-01-04 09:23:30.652  INFO 24620 --- [onPool-worker-3] c.v.base.devserver.DevModeHandlerImpl    : Running webpack to compile frontend resources. This may take a moment, please stand by...
/usr/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

Especially no ----------------- Frontend compiled successfully. ----------------- occurs

@vt512
Copy link

vt512 commented Jan 4, 2022

My environment for my last comment:

  • Project from start.vaadin.com (Vaadin Version changed in pom.xml)
  • Linux
  • Node 17.3.0
  • AdoptOpenJDK 11.0.11

@Artur-
Copy link
Member

Artur- commented Jan 4, 2022

Does /usr/bin/node --version really say 17.3.0 or could there be multiple node versions?

@vt512
Copy link

vt512 commented Jan 4, 2022

/usr/bin/node --version
v17.3.0

@Artur-
Copy link
Member

Artur- commented Jan 4, 2022

Not sure what is going on then

/usr/bin/node --help

should list

--openssl-legacy-provider  enable OpenSSL 3.0 legacy provider

and

/usr/bin/node   -p 'crypto.createHash("md4")'

should fail with "Error: error:0308010C:digital envelope routines::unsupported"

and

/usr/bin/node --openssl-legacy-provider  -p 'crypto.createHash("md4")'

should work and output

Hash { 
...

and the same for

NODE_OPTIONS=--openssl-legacy-provider /usr/bin/node -p 'crypto.createHash("md4")'

@vt512
Copy link

vt512 commented Jan 4, 2022

> /usr/bin/node --help | fgrep ssl
  --openssl-config=...        load OpenSSL configuration from the
  --use-openssl-ca            use OpenSSL's default CA store

> /usr/bin/node -p 'crypto.createHash("md4")'
Hash {
  _options: undefined,
  [Symbol(kHandle)]: Hash {},
  [Symbol(kState)]: { [Symbol(kFinalized)]: false }
}

> /usr/bin/node --openssl-legacy-provider -p 'crypto.createHash("md4")'
/usr/bin/node: bad option: --openssl-legacy-provider

> NODE_OPTIONS=--openssl-legacy-provider /usr/bin/node -p 'crypto.createHash("md4")'
/usr/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

@Artur-
Copy link
Member

Artur- commented Jan 4, 2022

We might need a fix similar to cloudflare/wrangler-legacy@38e32d1 then if it is possible that Node 17 is built with an older openssl

@Artur- Artur- changed the title Vaadin Flow 22 starter project fails to start Node 17 built with openssl < 3 does not work with Vaadin 22+ Jan 4, 2022
@Artur- Artur- changed the title Node 17 built with openssl < 3 does not work with Vaadin 22+ Node 17 built with openssl < 3 does not work with Vaadin 21.0.8+ Jan 4, 2022
@joheriks joheriks moved this from Needs triage to P1 - High priority in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Jan 4, 2022
@oflege
Copy link

oflege commented Jan 4, 2022

that seems to be it, node built w/ openssl@1.1 (default for brew install node) does not work on my mac, after switching to nvm v17.3.0 the sample project works

@Artur-
Copy link
Member

Artur- commented Jan 4, 2022

I think we should actually skip the version detection completely and instead check using

node -p 'crypto.createHash("md4")'

If that works, then webpack should work. If it fails, then you need the legacy option

@joheriks joheriks added the bug label Jan 4, 2022
@joheriks joheriks self-assigned this Jan 4, 2022
@joheriks joheriks moved this from P1 - High priority to WIP in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Jan 4, 2022
OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from WIP to Closed Jan 5, 2022
joheriks pushed a commit that referenced this issue Jan 5, 2022
Check if `node -p 'crypto.createHash("md4")'` works. If not, 
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649
vaadin-bot pushed a commit that referenced this issue Jan 5, 2022
Check if `node -p 'crypto.createHash("md4")'` works. If not, 
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649
joheriks pushed a commit that referenced this issue Jan 5, 2022
Check if `node -p 'crypto.createHash("md4")'` works. If not,
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649
joheriks pushed a commit that referenced this issue Jan 5, 2022
Check if `node -p 'crypto.createHash("md4")'` works. If not,
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649
joheriks pushed a commit that referenced this issue Jan 5, 2022
Check if `node -p 'crypto.createHash("md4")'` works. If not,
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649
joheriks pushed a commit that referenced this issue Jan 5, 2022
Check if `node -p 'crypto.createHash("md4")'` works. If not,
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649
joheriks pushed a commit that referenced this issue Jan 5, 2022
Check if `node -p 'crypto.createHash("md4")'` works. If not,
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649
vaadin-bot added a commit that referenced this issue Jan 5, 2022
…12677)

Check if `node -p 'crypto.createHash("md4")'` works. If not,
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649

Co-authored-by: Johannes Eriksson <joheriks@vaadin.com>
joheriks pushed a commit that referenced this issue Jan 5, 2022
Check if `node -p 'crypto.createHash("md4")'` works. If not,
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649
joheriks pushed a commit that referenced this issue Jan 5, 2022
Check if `node -p 'crypto.createHash("md4")'` works. If not,
pass the `--openssl-legacy-provider` flag. Workaround for:
webpack/webpack#14532
Fixes #12649
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 14.8.2.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 22.0.3.

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