Skip to content

fix: Make webpack work with Node 17 - #12353

Merged
pleku merged 3 commits into
masterfrom
node17-webpack
Nov 16, 2021
Merged

pleku merged 3 commits into
masterfrom
node17-webpack

Conversation

@Artur-

@Artur- Artur- commented Nov 12, 2021

Copy link
Copy Markdown
Member

No description provided.

@Artur-
Artur- marked this pull request as ready for review November 15, 2021 11:28
@Artur- Artur- changed the title fix: Make webpack start with Node 17 fix: Make webpack work with Node 17 Nov 15, 2021
@vaadin-bot vaadin-bot added +0.1.0 and removed +0.0.1 labels Nov 15, 2021
@joheriks
joheriks self-requested a review November 15, 2021 12:08
@joheriks

Copy link
Copy Markdown
Contributor

I get with Node v17.0.1 / npm 8.0.1:

/usr/local/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

@Artur-

Artur- commented Nov 16, 2021 •

Copy link
Copy Markdown
Member Author

That's odd because

$ node --openssl-legacy-provider 
Welcome to Node.js v17.0.0.

$ NODE_OPTIONS=--openssl-legacy-provider node
Welcome to Node.js v17.0.0.

The same with 17.0.1

@joheriks

Copy link
Copy Markdown
Contributor

Node 17.0.1 on macOS Catalina:

$ node -v
v17.0.1
$ NODE_OPTIONS=--openssl-legacy-provider node
node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

@Artur-

Artur- commented Nov 16, 2021

Copy link
Copy Markdown
Member Author

Does 17.1.0 work? I still see this on Big Sur

$ nvm use 16
Now using node v16.13.0 (npm v8.1.0)
$ NODE_OPTIONS=--openssl-legacy-provider node
node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
$ nvm use 17.0.0
Now using node v17.0.0 (npm v8.1.0)
$ NODE_OPTIONS=--openssl-legacy-provider node
Welcome to Node.js v17.0.0.
Type ".help" for more information.
> 
$ nvm use 17.0.1
Now using node v17.0.1 (npm v8.1.3)
$ NODE_OPTIONS=--openssl-legacy-provider node
Welcome to Node.js v17.0.1.
Type ".help" for more information.
> 

@joheriks

Copy link
Copy Markdown
Contributor

17.1.0 works.

$ node -v
v17.1.0
$ NODE_OPTIONS=--openssl-legacy-provider node
Welcome to Node.js v17.1.0.
Type ".help" for more information.
>

@Artur-

Artur- commented Nov 16, 2021

Copy link
Copy Markdown
Member Author

Should we check for 17.1.0 or newer then and just print an unsupported error for 17.0.x?

@joheriks

joheriks commented Nov 16, 2021 •

Copy link
Copy Markdown
Contributor

Sounds like a reasonable solution. We should verify that 17.1 works on other platforms as well (only tested macOS so far)

@pleku

pleku commented Nov 16, 2021 •

Copy link
Copy Markdown

Tested with node 17.1.0 & 17.0.1 on Windows 10 and both work.

@Artur-

Artur- commented Nov 16, 2021

Copy link
Copy Markdown
Member Author

Now throws an exception for Node 17.0.x

@vaadin-bot

Copy link
Copy Markdown
Collaborator

SonarQube analysis reported 12 issues

  • MAJOR 9 major
  • MINOR 3 minor

Top 10 issues

  1. MAJOR FrontendTools.java#L161: Define and throw a dedicated exception instead of using a generic one. rule
  2. MAJOR FrontendTools.java#L392: Constructor has 8 parameters, which is greater than 7 authorized. rule
  3. MAJOR FrontendTools.java#L701: A "NullPointerException" could be thrown; "output" is nullable here. rule
  4. MAJOR AbstractDevServerRunner.java#L115: Make "devServerStartFuture" transient or serializable. rule
  5. MAJOR AbstractDevServerRunner.java#L192: Invoke method(s) only conditionally. rule
  6. MAJOR AbstractDevServerRunner.java#L298: Remove this unused method parameter "nodeVersion". rule
  7. MAJOR AbstractDevServerRunner.java#L405: Either re-interrupt this method or rethrow the "InterruptedException". rule
  8. MAJOR AbstractDevServerRunner.java#L631: Null passed for non-null parameter of java.util.concurrent.CompletableFuture.getNow(Object) in com.vaadin.base.devserver.AbstractDevServerRunner.handleRequest(VaadinSession, VaadinRequest, VaadinResponse) rule
  9. MAJOR AbstractDevServerRunner.java#L678: Refactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed. rule
  10. MINOR FrontendTools.java#L693: Remove the declaration of thrown exception 'java.lang.IllegalStateException' which is a runtime exception. rule

@pleku
pleku merged commit 5a1260e into master Nov 16, 2021
@pleku
pleku deleted the node17-webpack branch November 16, 2021 12:39
@pleku

pleku commented Nov 16, 2021

Copy link
Copy Markdown

Pick to 2.7 will need to be done manually.

@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @Artur- and @pleku, when i performed cherry-pick to this commit to 8.0, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 5a1260e
error: could not apply 5a1260e... fix: Make webpack work with Node 17.1+ (#12353)
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add ' or 'git rm '
hint: and commit the result with 'git commit'

@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @Artur- and @pleku, when i performed cherry-pick to this commit to 2.7, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 5a1260e
error: could not apply 5a1260e... fix: Make webpack work with Node 17.1+ (#12353)
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add ' or 'git rm '
hint: and commit the result with 'git commit'

@joheriks

Copy link
Copy Markdown
Contributor

Tested with node 17.1.0 & 17.0.1 on Linux, both work.

Artur- added a commit that referenced this pull request Nov 16, 2021
Disallows usage of Node 17.0.

Fixes #12246, #12285
Artur- added a commit that referenced this pull request Nov 16, 2021
Disallows usage of Node 17.0.

Fixes #12246, #12285
pleku pushed a commit that referenced this pull request Nov 17, 2021
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with platform 22.0.0.rc1 and is also targeting the upcoming stable 22.0.0 version.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vaadin 21.0.3 is not working in development mode on Mac OS 12 / Monterey on M1

4 participants