hviana / faster_react

Full Stack web framework with React + Faster. Automatic routes, reload and component bundle. SSR + Hydration. 100% Deno, no Node dependencies. Fully compatible with Deno Deploy and Serverless Environments.
MIT License
15 stars 0 forks source link

Guard against missing build folder #1

Closed micmath closed 2 weeks ago

micmath commented 2 weeks ago

When following the "Creating a project" instructions in the project README you end up with an starter project that does not contain a build folder.

When running this project according to the documentation the build script throws an error because it is trying to create files in a build folder that doesn't exist. And of course the app cannot successfully function from that point on. (See full error messages below.)

I suggest either including an empty build folder in the starter project, or the core/builder.ts script should create and required folders when it starts up. Or else update the documentation to include the step of manually creating the build folder?

❯ deno task serve
Task serve deno run --allow-all --unstable-kv --watch-hmr core/start.ts
HMR Process started.
Error building pages and components
NotFound: No such file or directory (os error 2): writefile 'build/import-map.ts'
    at Object.writeFile (ext:deno_fs/30_fs.js:936:13)
    at Builder.buildComponentsScriptsAndPages (file:///myProjectFolder/core/builder.ts:362:18)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async Builder.buildAll (file:///myProjectFolder/core/builder.ts:292:5)
    at async Builder.init (file:///myProjectFolder/core/builder.ts:36:5) {
  name: "NotFound",
  code: "ENOENT"
}
Error compiling CSS files
NotFound: No such file or directory (os error 2): writefile 'build/concat.css'
    at Object.writeFile (ext:deno_fs/30_fs.js:936:13)
    at Builder.buildCSS (file:///myProjectFolder/core/builder.ts:424:18)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async Builder.buildAll (file:///myProjectFolder/core/builder.ts:293:5)
    at async Builder.init (file:///myProjectFolder/core/builder.ts:36:5) {
  name: "NotFound",
  code: "ENOENT"
}
Registered routes
Registered backend_pages_props functions
Listening on http://0.0.0.0:8080/
hviana commented 2 weeks ago

Hello. I made several corrections. Please create a new repository with the latest version and like my repository.

hviana commented 2 weeks ago

Fixed

hviana commented 2 weeks ago

just copy your app folder to the new project

hviana commented 2 weeks ago

I made improvements again (v5.0). If you can create a new project. You can take advantage of what you have developed, just create and copy the app folder to the new project.

hviana commented 2 weeks ago

*5.1

hviana commented 2 weeks ago

*5.2, sorry, it's hard to make it stable, but I think I got it now.