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

Cloudflare pages deploy error: Cannot access 'da' before initialization #29767

Closed
luizzappa opened this issue Nov 3, 2024 · 5 comments
Closed

Comments

@luizzappa
Copy link

Environment

  • Operating System: Windows_NT
  • Node Version: v20.17.0
  • Nuxt Version: 3.13.2
  • CLI Version: 3.14.0
  • Nitro Version: 2.10.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Describe the bug

When updating the version from nuxt 3.8.1 to 3.13.2, this error started to appear when deploying to cloudflare pages (Worker):

20:31:46.397 | ✨ Success! Uploaded 3 files (207 already uploaded) (0.92 sec)
-- | --
20:31:46.397 |  
20:31:46.659 | ✨ Upload complete!
20:31:49.337 | Success: Assets published!
20:31:51.011 | Error: Failed to publish your Function. Got error: Uncaught ReferenceError: Cannot access 'da' before initialization   at chunks/nitro/nitro.mjs:1:522814 in useRuntimeConfig   at chunks/nitro/nitro.mjs:1:386806

Additional context

No response

Logs

No response

Copy link
Contributor

github-actions bot commented Nov 3, 2024

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
👉 https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

@luizzappa
Copy link
Author

Ok, the Nitro 2.10.1 version resolved the problem, but the following message began to appear multiple times when trying to deploy to cloudflare:

10:02:28.640	[plugin commonjs--resolver] It appears a plugin has implemented a "resolveId" hook that uses "this.resolve" without forwarding the third "options" parameter of "resolveId". This is problematic as it can lead to wrong module resolutions especially for the node-resolve plugin and in certain cases cause early exit errors for the commonjs plugin.
10:02:28.641	In rare cases, this warning can appear if the same file is both imported and required from the same mixed ES/CommonJS module, in which case it can be ignored.

My package.json

 "overrides": {
    "vue": "^3.5.12",
    "nitropack": "2.10.1"
  }

@pi0
Copy link
Member

pi0 commented Nov 3, 2024

Please try recreating your lockfile. If issue persists sharing a reproduction can be super helpful to investigate.

@pi0
Copy link
Member

pi0 commented Nov 3, 2024

Warning should be solved in latest Nitro (2.10.2)

@luizzappa
Copy link
Author

I updated to version 2.10.2 of Nitro and the messages no longer appear. Thanks for the quick support @pi0 !

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

No branches or pull requests

3 participants