-
Notifications
You must be signed in to change notification settings - Fork 59
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
Cannot access 'tc' before initialization #363
Comments
What is displayed when your run |
|
instaling "nitropack": "2.9.7" and adding
to package.json solved my issue for now |
✅ Nitro 2.10.1 is released with a (related) fix. Recreating lock file should solve the problem. |
Hi Getting this error during deployment Error: Failed to publish your Function. Got error: Uncaught Error: Missing Cloudflare DB binding (D1) |
Could you please try with nuxthub/core 0.8.5? |
Still same error with fallowing
|
How do you deploy your app @aligzl ? |
trough github actions |
Hi @atinux |
Do you mind inviting me to your project? Did you change anything in the bindings of your project on Cloudflare? |
I have invited you to my project and i did not touch anything in the bindings |
I found the issue @aligzl You should not call - export const todoDb = new todoService(hubDatabase())
+ export const todoDb = () => new todoService(hubDatabase()) You will need to update This is because the bindings are available only when the request comes in, so inside the event handlers, before this, they are not ready, thus the error happening (I believe Cloudflare try to run the code before deploying it). |
let me try, Thanks for your kind help |
It was an issue if it was working before I believe, it was probably related to how the chunks were generated with Nitro. |
It works as expected now Thanks |
Where do you think would be the best place? |
Describe the bug
Hi, i cant deploy my app as getting error about hubDatabase during the deployment
17:48:42.892 Error: Failed to publish your Function. Got error: Uncaught ReferenceError: Cannot access 'tc' before initialization
at chunks/nitro/nitro.mjs:1:588600 in useRuntimeConfig
at chunks/nitro/nitro.mjs:1:225944 in requireNuxtHubFeature
at chunks/nitro/nitro.mjs:1:444655 in hubDatabase
at chunks/nitro/nitro.mjs:1:458639
Steps to reproduce
Steps to reproduce the behavior:
Deplyment Logs
The text was updated successfully, but these errors were encountered: