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

Data binding does't work when deploying to CloudFlare (NX) #1015

Closed
2 tasks
dalenguyen opened this issue Apr 8, 2024 · 7 comments
Closed
2 tasks

Data binding does't work when deploying to CloudFlare (NX) #1015

dalenguyen opened this issue Apr 8, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@dalenguyen
Copy link
Contributor

Please provide the environment you discovered this bug in.

Repo: dalenguyen/cloudflare-challenge#6
Link: https://add-whisper.cloudflare-challange.pages.dev/ (try to click on the the recording, the log shows the result, but the form field is not updated)
Host: Cloudflare Pages

Which area/package is the issue in?

Don't know / other

Description

I'm trying to adding a simple form and use data binding for updating the value. However, the form field is not updated properly even though the data is present. Here what I tried:

  • Use simple ngModel
  • Use Reactive Forms
  • Add extra detectChanges

Please provide the exception or error you saw

No response

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@dalenguyen dalenguyen added the bug Something isn't working label Apr 8, 2024
@dalenguyen
Copy link
Contributor Author

Updated: the binding works when using viewChild to manually set the value of the input.

@dalenguyen
Copy link
Contributor Author

Hi @brandonroberts, I don't think this is fixed yet. The data binding (ngModel) or change detection doesn't really work when deploying to Cloudflare.

@dalenguyen dalenguyen changed the title Data binding does't work when deploying to CloudFlare Data binding does't work when deploying to CloudFlare (NX) Apr 24, 2024
@dalenguyen
Copy link
Contributor Author

dalenguyen commented Apr 24, 2024

I think the vite.config.ts for NX has an issue. I was trying to mimic the vite.config from non NX app. It does work, so I think these two are the cause: reportCompressedSize & commonjsOptions.

   build: {
      reportCompressedSize: true, <-- remove
      commonjsOptions: { transformMixedEsModules: true }, <-- remove
      target: ["es2020"],
    },

@brandonroberts
Copy link
Member

Oh, interesting. I could why maybe the commonjsoptions could, but the other is just reporting

@dalenguyen
Copy link
Contributor Author

Probably, it's not present in the normal create command. I can create a PR for this after some testings if you want :D

@brandonroberts
Copy link
Member

Sounds good 👍

@brandonroberts
Copy link
Member

Closed by #1052

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

No branches or pull requests

2 participants