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: When I run "npx wrangler types --env-interface CloudflareBindings" while using jsx in my entrypoint I get a parse error. #6488

Closed
yomashishi opened this issue Aug 13, 2024 · 3 comments
Labels
bug Something that isn't working

Comments

@yomashishi
Copy link

Which Cloudflare product(s) does this pertain to?

Wrangler

What version(s) of the tool(s) are you using?

3.71.0 [Wrangler]

What version of Node are you using?

20.14.0

What operating system and version are you using?

WSL Ubuntu 22.04.3 LTS

Describe the Bug

Observed behavior

When I run "npx wrangler types --env-interface CloudflareBindings" while using jsx in my entrypoint I get a parse error.

Expected behavior

Running "npx wrangler types --env-interface CloudflareBindings" for an entrypoint using jsx should not result in a parse error.


Sorry if I missed any notes.

Please provide a link to a minimal reproduction

https://github.com/yomashishi/parse-error-when-wrangler-types-command

Please provide any relevant error logs


--- 2024-08-13T17:12:18.769Z debug
🪵  Writing logs to "/home/xxxxxxxx/.config/.wrangler/logs/wrangler-2024-08-13_17-12-18_518.log"
---

--- 2024-08-13T17:12:18.769Z debug
Failed to load .env file ".env": Error: ENOENT: no such file or directory, open '.env'
    at Object.openSync (node:fs:573:18)
    at Object.readFileSync (node:fs:452:35)
    at tryLoadDotEnv (/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:157723:72)
    at loadDotEnv (/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:157732:12)
    at /home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:203219:20
    at /home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:165954:16
    at maybeAsyncResult (/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:164175:44)
    at /home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:165953:14
    at /home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:164162:22
    at Array.reduce (<anonymous>) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '.env'
}
---

--- 2024-08-13T17:12:18.792Z log

 ⛅️ wrangler 3.71.0
�[38;2;255;136;0m-------------------�[39m

---

--- 2024-08-13T17:12:18.794Z debug
No experimental flag store instantiated
---

--- 2024-08-13T17:12:18.794Z debug
Attempted to use flag "JSON_CONFIG_FILE" which has not been instantiated
---

--- 2024-08-13T17:12:18.804Z debug
Failed to load .env file "/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/.dev.vars": Error: ENOENT: no such file or directory, open '/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/.dev.vars'
    at Object.openSync (node:fs:573:18)
    at Object.readFileSync (node:fs:452:35)
    at tryLoadDotEnv (/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:157723:72)
    at loadDotEnv (/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:157732:12)
    at getVarsForDev (/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:199003:18)
    at Object.typesHandler [as handler] (/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/node_modules/wrangler/wrangler-dist/cli.js:199179:19) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/xxxxxxxx/ghq/github.com/yomashishi/parse-error-when-wrangler-types-command/.dev.vars'
}
---

--- 2024-08-13T17:12:18.829Z log

---

--- 2024-08-13T17:12:18.892Z error
�[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mParse error @:21:34�[0m


---

--- 2024-08-13T17:12:18.892Z log
�[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose�[0m
---

--- 2024-08-13T17:12:31.426Z debug
Sentry: Reporting disabled - would have sent Error: Parse error @:21:34.
---
@yomashishi yomashishi added the bug Something that isn't working label Aug 13, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Aug 13, 2024
@CarmenPopoviciu
Copy link
Contributor

@andyjessop probably relevant to your work on wrangler types

@edmundhung edmundhung moved this from Untriaged to Backlog in workers-sdk Aug 19, 2024
@emily-shen
Copy link
Contributor

Hey! I just tested this and it appears to be fixed on the latest wrangler with this PR #7073. Let us know if you have any issues though :)

@github-project-automation github-project-automation bot moved this from Backlog to Done in workers-sdk Oct 31, 2024
@yomashishi
Copy link
Author

It worked! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants