flow: Vite fails with not exported node module

Actual behavior

gradlew clean build fails with:

> Task :vaadinBuildFrontend FAILED

 ***** All completed @ Sun Oct 16 13:23:54 CEST 2022  ***

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':vaadinBuildFrontend'.
> Vite process exited with non-zero exit code.
  Stderr: 'vite v3.1.0 building for production...
  transforming...
  Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
  Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
  ? 876 modules transformed.
  'render' is not exported by node_modules/lit/index.js, imported by node_modules/@vaadin/flow-frontend/lit-renderer.ts
  file: D:/Hausi/lessoria-ui/node_modules/@vaadin/flow-frontend/lit-renderer.ts:1:9
  1: import { render, html } from 'lit';
              ^
  2:
  3: type RenderRoot = HTMLElement & { __litRenderer?: Renderer; _$litPart$?: any };
  error during build:
  Error: 'render' is not exported by node_modules/lit/index.js, imported by node_modules/@vaadin/flow-frontend/lit-renderer.ts
      at error (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
      at Module.error (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:12429:16)
      at Module.traceVariable (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:12788:29)
      at ModuleScope.findVariable (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:11440:39)
      at ReturnValueScope.findVariable (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:6372:38)
      at ChildScope.findVariable (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:6372:38)
      at Identifier.bind (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:7439:40)
      at CallExpression.bind (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:5265:73)
      at CallExpression.bind (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:8935:15)
      at VariableDeclarator.bind (file:///D:/Hausi/lessoria-ui/node_modules/rollup/dist/es/shared/rollup.js:5269:23)
  '

Versions:

- Vaadin / Flow version: 23.2.4
- Java version: OpenJDK 64-Bit Server VM Temurin-17.0.4+8 (build 17.0.4+8, mixed mode, sharing)
- OS version: Windows 11
- Browser version (if applicable):
- Application Server (if applicable): Spring
- IDE (if applicable): gradlew clean build
- Development or production mode: production mode
- Project from start.vaadin.com or activated in application:

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 24 (12 by maintainers)

Most upvoted comments

I’d guess we only have an add-on issue here and no framework issue so this could be closed?

I couldn’t make the project build or to test it right away, but let’s continue the discussion in: https://github.com/parttio/grid-pagination/issues/22

Excellent, big thanks! I’ll ask Sami to change the ownership in the vaadin.com/directory, after that I can cut a new release 👍

Hi, I only now got notification about the activity on the grid-pagination repository. I have not been using the Klaudeta Github account for a long time and same goes for the grid-pagination activity. I can’t actively maintain the add-on for the time being, sorry about this. Anyway I did merge the open PRs but I can’t publish a new release of the add-on in the Vaadin directory. I do not have access anymore with the old credentials. Feel free to fork it and create a new Vaadin add-on in the directory.

Hi! I just made a pull request for the grid-pagination to be compatible with 23.2.4+. I hope it will be merged. https://github.com/gl0b3/grid-pagination/tree/3.0.0 @mstahv @jmart1 Thank you for the hints!

Ok that worked. Now I gotta find a replacement for grid-pagination.

@mstahv Thank you!!!

My contribution to the grid-pagination addon is rather lame 😊 https://github.com/Klaudeta/grid-pagination/commit/5340cd528870b3ce36b9d14921d40ac4780a186c

Klaudeta moved to another company, getting the add-on updated might indeed be hard via her. @SebastianKuehnau has done some actual improvements for the project, would Sebastian you would be interested to take over this add-on? I guess it is fairly commonly used.

A quick fix might be to switch to this paging grid implementation in in.virit:viritin. That is built with server side composition instead of Lit, so it shouldn’t be that fragile with the constantly changing front-end world. Usage example.