Vaadin 14+ npm mode - Production profile

Luigi Ducci:
Hi, i faced the same issue this morning so in a command prompt inside the root project folder you have to launch :

node node_modules\webpack\bin\webpack.js

This will build the desired file stats.json .

Hi, thanks for your reply.

I did executed as you mention getting following error.

C:\Development\workspace\soft\counting-web>node node_modules\webpack\bin\webpack.js
i 「atl」: Using typescript@3.7.3 from typescript
i 「atl」: Using tsconfig.json from C:/Development/workspace/soft/counting-web/tsconfig.json
i 「atl」: Checking started in a separate process...
× 「atl」: Checking finished with 2 errors
Hash: fa7e89b7006d4e70abbe
Version: webpack 4.42.0
Time: 3332ms
Built at: 2020-05-07 8:53:28
Entrypoint bundle =
[0]
 ../target/index.ts + 1 modules 92.2 KiB {0} [built]

    | ../target/index.ts 1.46 KiB [built]

    |     + 1 hidden module

ERROR in ../target/index.ts
Module not found: Error: Can't resolve '../target/frontend/generated-flow-imports' in 'C:\Development\workspace\soft\counting-web\target'
 @ ../target/index.ts 17:19-70

ERROR in ../target/index.ts
Module not found: Error: Can't resolve '@vaadin/flow-frontend/Flow' in 'C:\Development\workspace\soft\counting-web\target'
 @ ../target/index.ts 15:0-50 16:33-37

ERROR in chunk bundle [entry]

build/vaadin-bundle-a427b921febfb9ca0ea2.cache.js
C:\Development\workspace\soft\counting-web\node_modules\awesome-typescript-loader\dist\entry.js!C:\Development\workspace\soft\counting-web\target\index.ts 052da964a93a474bf00dd0019aa9cf65
Unexpected token (17:33)
| // import Flow module to enable navigation to Vaadin server-side views
| 
| const { serverSideRoutes } = new !(function webpackMissingModule() { var e = new Error("Cannot find module '@vaadin/flow-frontend/Flow'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())({
|     imports: () => Promise.resolve().then(function webpackMissingModule() { var e = new Error("Cannot find module '../target/frontend/generated-flow-imports'"); e.code = 'MODULE_NOT_FOUND'; throw e; })
| });

ERROR in [at-loader]
 ./target/index.ts:18:20 
    TS2307: Cannot find module '@vaadin/flow-frontend/Flow'.

ERROR in [at-loader]
 ./target/index.ts:21:25 
    TS2307: Cannot find module '../target/frontend/generated-flow-imports'.
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [0]
 ../node_modules/html-webpack-plugin/lib/loader.js!../target/index.html 1.08 KiB {0} [built]

        + 3 hidden modules