Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in server.ts prevents this from running #215

Open
osseonews opened this issue Nov 5, 2023 · 7 comments
Open

Bug in server.ts prevents this from running #215

osseonews opened this issue Nov 5, 2023 · 7 comments

Comments

@osseonews
Copy link

app.get("/public/*", async (ctx) => {
  return await ctx.env.ASSETS.fetch(ctx.req.raw);
});

line 44 in server.ts throws an error. ASSETS is undefined. What is this ENV supposed to be and where? Also, get an error: "Property 'fetch' does not exist on type 'string'

Not sure if this error is what is causing the admin to not work at all, i.e. we can't create new records in the tables we have set up or edit anything else.

@lane711
Copy link
Owner

lane711 commented Nov 7, 2023

Are you able to access http://0.0.0.0:8788/status when running locally? If so, what is the output?

Did you create your app with npx create-sonicjs-app ?

@osseonews
Copy link
Author

osseonews commented Nov 8, 2023

No, we couldn't use npx create-sonicjs-app. Just kept throwing errors. Honestly, I think the idea with this repo is brilliant here and is exactly what I envisioned as the best type of CRM infrastructure that can scale, and is not expensive. I just really could just not get it set up as a package. Just didn't work at all. So I've had to just go folder by folder and try to get stuff working. I've used Workers for a few years, so quite familiar with the platform.

@lane711
Copy link
Owner

lane711 commented Nov 8, 2023

Sorry to hear that. If the npx script isn't working for you, you should be able to:

  1. Clone the repo
  2. npm install
  3. rename /wrangler.example.toml to /wrangler.toml
  4. fill in the values of wrangler.toml per the instructions included in the same file as comments.
  5. npm run dev

Please post any errors that you are getting with this process. I'd like to get them fixed.

Please also share OS, node version, etc so that I can attempt to replicate.

@lane711
Copy link
Owner

lane711 commented Nov 8, 2023

Here is what your status page should look like. Note that ASSETS are included in the env from Hono js.

Screenshot 2023-11-08 at 7 17 16 AM

@osseonews
Copy link
Author

I'll try to do everything again. But, also, I still get this error, raised by someone else in another issue: "Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:readline/promises"

@lane711
Copy link
Owner

lane711 commented Nov 8, 2023

What OS & node version on you using?

@osseonews
Copy link
Author

osseonews commented Nov 8, 2023

OK, I got it working now locally after cloning it again. But the server.ts still has an error: ```
app.get("/public/*", async (ctx) => {
return await ctx.env.ASSETS.fetch(ctx.req.raw);

Error is that Fetch does not exist on type string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants