microeinhundert / radonis

Build monolithic applications with a modern, React-based frontend stack based on the Node.js MVC framework AdonisJS.
https://radonis.vercel.app/
MIT License
67 stars 2 forks source link

E_CANNOT_BUILD: Cannot build the Radonis client bundle #11

Closed finestgecko closed 2 years ago

finestgecko commented 2 years ago

I followed the migration steps but when I start my app, I get this error:

> diagram@1.0.0 dev
> concurrently 'npm:dev:*'

[dev:*client] 
[dev:*client] > diagram@1.0.0 dev:client
[dev:*client] > node ace build:client --watch './resources/!(views)/**/*.ts(x)?'
[dev:*client] 
[dev:*server] 
[dev:*server] > diagram@1.0.0 dev:server
[dev:*server] > node ace serve --watch
[dev:*server] 
[dev:*server] [ info ]  building project...
[dev:*server] [ info ]  starting http server...
[dev:*client]
[dev:*client]   BuildException 
[dev:*client] 
[dev:*client]  E_CANNOT_BUILD: Cannot build the Radonis client bundle
[dev:*client] 
[dev:*client] 
[dev:*client]    1  Function.cannotBuild
[dev:*client]      /home/joel/diagram/node_modules/@microeinhundert/radonis-build/src/exceptions/buildException.ts:28
[dev:*client] 
[dev:*client]    2  build
[dev:*client]      /home/joel/diagram/node_modules/@microeinhundert/radonis-build/src/build.ts:165
[dev:*client] 
[dev:*client]    3  BuildClient.#buildClient
[dev:*client]      /home/joel/diagram/node_modules/@microeinhundert/radonis-server/commands/BuildClient.ts:114
[dev:*client] 
[dev:*client]    4  BuildClient.run
[dev:*client]      /home/joel/diagram/node_modules/@microeinhundert/radonis-server/commands/BuildClient.ts:142
[dev:*client] 
[dev:*client]    5  BuildClient.exec
[dev:*client]      /home/joel/diagram/node_modules/@adonisjs/ace/build/src/BaseCommand/index.js:157
[dev:*client] 
[dev:*client]    6  Kernel.handle
[dev:*client]      /home/joel/diagram/node_modules/@adonisjs/ace/build/src/Kernel/index.js:553
[dev:*client] 
[dev:*client]    7  App.handle
[dev:*client]      /home/joel/diagram/node_modules/@adonisjs/core/build/src/Ignitor/Ace/App/index.js:226
[dev:*client] 
[dev:*client]    8  Ace.handle
[dev:*client]      /home/joel/diagram/node_modules/@adonisjs/core/build/src/Ignitor/Ace/index.js:33
[dev:*client] 
[dev:*client] npm run dev:client exited with code 1
[dev:*server] [17:28:03.348] INFO (diagram/85715): started server on 0.0.0.0:3333
[dev:*server] [ info ]  watching file system for changes
[dev:*server] ╭─────────────────────────────────────────────────╮
[dev:*server] │                                                 │
[dev:*server] │    Server address: http://127.0.0.1:3333        │
[dev:*server] │    Watching filesystem for changes: YES         │
[dev:*server] │                                                 │
[dev:*server] ╰─────────────────────────────────────────────────╯
^C[dev:*server] npm run dev:server exited with code SIGINT

There isn't really much else in the way of context.

I am upgrading from 1.11.4.

Does every hydratable descendant of a HydrationRoot need to be wrapped in hydratable() or just the first child?

microeinhundert commented 2 years ago

Only the first child needs to be wrapped with hydratable. Your error seems like there is something wrong with the actual build. The error message is not helpful, I fixed that in the latest version 2.0.1.

finestgecko commented 2 years ago

Thank you. That gives much more context and I have solved the problem.

[dev:*client]   BuildException 
[dev:*client] 
[dev:*client]  E_CANNOT_BUILD: Cannot build the Radonis client bundle: Build failed with 32 errors:
[dev:*client] node_modules/@microeinhundert/radonis-unocss/build/esm/src/plugin.js:13:29: ERROR: Could not resolve "fs"
[dev:*client] node_modules/@microeinhundert/radonis-unocss/build/esm/src/plugin.js:14:21: ERROR: Could not resolve "path"
[dev:*client] node_modules/@poppinss/file-generator/build/src/files/docx/index.js:12:23: ERROR: Could not resolve "path"
[dev:*client] node_modules/@poppinss/file-generator/build/src/files/docx/index.js:13:25: ERROR: Could not resolve "crypto"
[dev:*client] node_modules/@poppinss/file-generator/build/src/files/docx/index.js:14:27: ERROR: Could not resolve "fs/promises"

With the radonis-twind plugin, it was necessary to include it in entry.client.ts. While migrating to radonis-unocss, I also defined the plugin in the client, but it seems to be no longer necessary. I removed it from there and the problem is solved.

As ever, thanks for your efforts with Radonis—it's one of my favourite open source projects right now.